diff --git a/configure b/configure index 646f44ede24..d91a345acfe 100755 --- a/configure +++ b/configure @@ -18654,6 +18654,34 @@ printf "%s\n" "$ac_cv_cflags__fcf_protection_none" >&6; } if test "x$ac_cv_cflags__fcf_protection_none" = xyes then : EXTRACFLAGS="$EXTRACFLAGS -fcf-protection=none" +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fvisibility=hidden" >&5 +printf %s "checking whether the compiler supports -fvisibility=hidden... " >&6; } +if test ${ac_cv_cflags__fvisibility_hidden+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -fvisibility=hidden" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(int argc, char **argv) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_cflags__fvisibility_hidden=yes +else $as_nop + ac_cv_cflags__fvisibility_hidden=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fvisibility_hidden" >&5 +printf "%s\n" "$ac_cv_cflags__fvisibility_hidden" >&6; } +if test "x$ac_cv_cflags__fvisibility_hidden" = xyes +then : + EXTRACFLAGS="$EXTRACFLAGS -fvisibility=hidden" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-stack-protector" >&5 printf %s "checking whether the compiler supports -fno-stack-protector... " >&6; } @@ -19358,34 +19386,6 @@ printf "%s\n" "$ac_cv_cflags__fshort_wchar" >&6; } if test "x$ac_cv_cflags__fshort_wchar" = xyes then : MSVCRTFLAGS="$MSVCRTFLAGS -fshort-wchar" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fvisibility=hidden" >&5 -printf %s "checking whether the compiler supports -fvisibility=hidden... " >&6; } -if test ${ac_cv_cflags__fvisibility_hidden+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fvisibility=hidden" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fvisibility_hidden=yes -else $as_nop - ac_cv_cflags__fvisibility_hidden=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fvisibility_hidden" >&5 -printf "%s\n" "$ac_cv_cflags__fvisibility_hidden" >&6; } -if test "x$ac_cv_cflags__fvisibility_hidden" = xyes -then : - MSVCRTFLAGS="$MSVCRTFLAGS -fvisibility=hidden" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wno-format" >&5 printf %s "checking whether the compiler supports -Wno-format... " >&6; } diff --git a/configure.ac b/configure.ac index fd1a58b9170..8a58ef8a5b5 100644 --- a/configure.ac +++ b/configure.ac @@ -1841,6 +1841,7 @@ then WINE_TRY_CFLAGS([-Werror=unused-command-line-argument],[CFLAGS="$CFLAGS -Werror=unused-command-line-argument"]) WINE_TRY_CFLAGS([-Werror=ignored-optimization-argument],[CFLAGS="$CFLAGS -Werror=ignored-optimization-argument"]) WINE_TRY_CFLAGS([-fcf-protection=none]) + WINE_TRY_CFLAGS([-fvisibility=hidden]) WINE_TRY_CFLAGS([-fno-stack-protector]) WINE_TRY_CFLAGS([-fno-strict-aliasing]) WINE_TRY_CFLAGS([-Wdeclaration-after-statement]) @@ -1922,7 +1923,6 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy= *) MSVCRTFLAGS="-D_WIN32" WINE_TRY_CFLAGS([-fno-builtin],[MSVCRTFLAGS="$MSVCRTFLAGS -fno-builtin"]) WINE_TRY_CFLAGS([-fshort-wchar],[MSVCRTFLAGS="$MSVCRTFLAGS -fshort-wchar"]) - WINE_TRY_CFLAGS([-fvisibility=hidden],[MSVCRTFLAGS="$MSVCRTFLAGS -fvisibility=hidden"]) WINE_TRY_CFLAGS([-Wno-format],[MSVCRTFLAGS="$MSVCRTFLAGS -Wno-format"]) ;; esac diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 0db25f88527..875e2f48cc7 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2305,7 +2305,7 @@ static void check_command_line( int argc, char *argv[] ) * * Main entry point called by the wine loader. */ -void __wine_main( int argc, char *argv[], char *envp[] ) +DECLSPEC_EXPORT void __wine_main( int argc, char *argv[], char *envp[] ) { init_paths( argv ); diff --git a/include/dde.h b/include/dde.h index fda798b06f4..7b236414dac 100644 --- a/include/dde.h +++ b/include/dde.h @@ -30,7 +30,7 @@ extern "C" { #ifndef WINUSERAPI #if defined(_USER32_) || defined(WINE_UNIX_LIB) -#define WINUSERAPI +#define WINUSERAPI DECLSPEC_EXPORT #else #define WINUSERAPI DECLSPEC_IMPORT #endif diff --git a/include/ddeml.h b/include/ddeml.h index 41c43e6b321..0bffa851c79 100644 --- a/include/ddeml.h +++ b/include/ddeml.h @@ -28,7 +28,7 @@ extern "C" { #ifndef WINUSERAPI #if defined(_USER32_) || defined(WINE_UNIX_LIB) -#define WINUSERAPI +#define WINUSERAPI DECLSPEC_EXPORT #else #define WINUSERAPI DECLSPEC_IMPORT #endif diff --git a/include/ntgdi.h b/include/ntgdi.h index 95aba913c05..c2cb1924730 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -26,7 +26,7 @@ #ifndef W32KAPI # if defined(_WIN32U_) || defined(WINE_UNIX_LIB) -# define W32KAPI +# define W32KAPI DECLSPEC_EXPORT # else # define W32KAPI DECLSPEC_IMPORT # endif diff --git a/include/ntuser.h b/include/ntuser.h index 1fed42e38df..def89a82aff 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -27,7 +27,7 @@ #ifndef W32KAPI # if defined(_WIN32U_) || defined(WINE_UNIX_LIB) -# define W32KAPI +# define W32KAPI DECLSPEC_EXPORT # else # define W32KAPI DECLSPEC_IMPORT # endif diff --git a/include/rpc.h b/include/rpc.h index 0b029532655..2d4323428c4 100644 --- a/include/rpc.h +++ b/include/rpc.h @@ -43,7 +43,7 @@ #if !defined(_RPCRT4_) && !defined(_KRPCENV_) #define RPCRTAPI DECLSPEC_IMPORT #else -#define RPCRTAPI +#define RPCRTAPI DECLSPEC_EXPORT #endif #endif diff --git a/include/wine/debug.h b/include/wine/debug.h index 281666fbff1..86e008a1408 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -109,11 +109,11 @@ struct __wine_debug_channel #endif NTSYSAPI int WINAPI __wine_dbg_write( const char *str, unsigned int len ); -extern unsigned char __cdecl __wine_dbg_get_channel_flags( struct __wine_debug_channel *channel ); -extern const char * __cdecl __wine_dbg_strdup( const char *str ); -extern int __cdecl __wine_dbg_output( const char *str ); -extern int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_channel *channel, - const char *function ); +extern DECLSPEC_EXPORT unsigned char __cdecl __wine_dbg_get_channel_flags( struct __wine_debug_channel *channel ); +extern DECLSPEC_EXPORT const char * __cdecl __wine_dbg_strdup( const char *str ); +extern DECLSPEC_EXPORT int __cdecl __wine_dbg_output( const char *str ); +extern DECLSPEC_EXPORT int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_channel *channel, + const char *function ); /* * Exported definitions and macros diff --git a/include/wine/unixlib.h b/include/wine/unixlib.h index 46b5e982943..81c59e732ba 100644 --- a/include/wine/unixlib.h +++ b/include/wine/unixlib.h @@ -29,8 +29,8 @@ typedef UINT64 unixlib_handle_t; typedef NTSTATUS (*unixlib_entry_t)( void *args ); -extern const unixlib_entry_t __wine_unix_call_funcs[]; -extern const unixlib_entry_t __wine_unix_call_wow64_funcs[]; +extern DECLSPEC_EXPORT const unixlib_entry_t __wine_unix_call_funcs[]; +extern DECLSPEC_EXPORT const unixlib_entry_t __wine_unix_call_wow64_funcs[]; /* some useful helpers from ntdll */ NTSYSAPI const char *ntdll_get_build_dir(void); diff --git a/include/wingdi.h b/include/wingdi.h index 6ae9409803c..ff0bbb6fc85 100644 --- a/include/wingdi.h +++ b/include/wingdi.h @@ -26,7 +26,7 @@ extern "C" { #ifndef WINGDIAPI #if defined(_GDI32_) || defined(WINE_UNIX_LIB) -#define WINGDIAPI +#define WINGDIAPI DECLSPEC_EXPORT #else #define WINGDIAPI DECLSPEC_IMPORT #endif diff --git a/include/winnt.h b/include/winnt.h index 7bbf224e3c9..4739f9a1a0f 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -43,7 +43,7 @@ extern "C" { #endif #if defined(_NTSYSTEM_) || defined(WINE_UNIX_LIB) -#define NTSYSAPI +#define NTSYSAPI DECLSPEC_EXPORT #else #define NTSYSAPI DECLSPEC_IMPORT #endif diff --git a/include/winuser.h b/include/winuser.h index c0736502a2e..73e7919aaea 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -23,7 +23,7 @@ #if !defined(_USER32_) && !defined(WINE_UNIX_LIB) #define WINUSERAPI DECLSPEC_IMPORT #else -#define WINUSERAPI +#define WINUSERAPI DECLSPEC_EXPORT #endif #endif diff --git a/loader/main.c b/loader/main.c index 242ff15accd..c258e025183 100644 --- a/loader/main.c +++ b/loader/main.c @@ -39,7 +39,7 @@ extern char **environ; /* the preloader will set this variable */ -const struct wine_preload_info *wine_main_preload_info = NULL; +const __attribute((visibility("default"))) struct wine_preload_info *wine_main_preload_info = NULL; /* canonicalize path and return its directory name */ static char *realpath_dirname( const char *name )