configure: Use hidden visibility also when building Unix libraries.

This commit is contained in:
Alexandre Julliard 2023-11-08 10:27:08 +01:00
parent c7a2aaf234
commit 4502eb56ba
14 changed files with 46 additions and 46 deletions

56
configure vendored
View file

@ -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; }

View file

@ -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

View file

@ -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 );

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -43,7 +43,7 @@
#if !defined(_RPCRT4_) && !defined(_KRPCENV_)
#define RPCRTAPI DECLSPEC_IMPORT
#else
#define RPCRTAPI
#define RPCRTAPI DECLSPEC_EXPORT
#endif
#endif

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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

View file

@ -23,7 +23,7 @@
#if !defined(_USER32_) && !defined(WINE_UNIX_LIB)
#define WINUSERAPI DECLSPEC_IMPORT
#else
#define WINUSERAPI
#define WINUSERAPI DECLSPEC_EXPORT
#endif
#endif

View file

@ -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 )