[PATCH v2 0/1] MR4401: include: Don't use dllexport attribute for PE modules.
Recent change to make unixlibs use hidden visibility made DECLSPEC_EXPORT being used in more cases. This means that it's used for PE modules as well, which is meant to be ignored since we use .spec files and winebuild-generated .edata anyway. This has some side effects: - LLD correctly ignores dllexport when it detects .edata presence, but it also issues a warning: `lld-link: warning: literal .edata sections override exports` - AFAIR (I didn't verify), GNU LD would still generate its own .edata entries, but the one provided by winebuild will be actually used by PE header - non-mingw builds will use default visibility for those symbols in PE modules -- v2: include: Don't use dllexport attribute for Wine PE modules. https://gitlab.winehq.org/wine/wine/-/merge_requests/4401
From: Jacek Caban <jacek(a)codeweavers.com> --- include/winnt.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/winnt.h b/include/winnt.h index d1c82084f9f..0af765652b7 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -180,7 +180,10 @@ extern "C" { /* a couple of useful Wine extensions */ -#ifdef _MSC_VER +#if defined(__WINESRC__) && !defined(WINE_UNIX_LIB) +/* Wine uses .spec file for PE exports */ +# define DECLSPEC_EXPORT +#elif defined(_MSC_VER) # define DECLSPEC_EXPORT __declspec(dllexport) #elif defined(__MINGW32__) # define DECLSPEC_EXPORT __attribute__((dllexport)) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4401
On Wed Nov 15 15:37:08 2023 +0000, Alexandre Julliard wrote:
Wouldn't it be easier to simply #define DECLSPEC_EXPORT to nothing for PE builds? Sure, I wasn't sure about that. Marking debug functions that are not meant to be exported with DECLSPEC_EXPORT seems a bit misleading, but it's not a big deal.
I used `!defined(WINE_UNIX_LIB)` instead of `__WINE_PE_BUILD` to also cover non-mingw builds. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4401#note_52390
participants (2)
-
Jacek Caban -
Jacek Caban (@jacek)