diff --git a/config/visibility.m4 b/config/visibility.m4 new file mode 100644 index 00000000000..19530f90bb1 --- /dev/null +++ b/config/visibility.m4 @@ -0,0 +1,14 @@ +dnl Check whether the target supports hidden visibility. +AC_DEFUN([GCC_CHECK_ATTRIBUTE_VISIBILITY], [ + AC_CACHE_CHECK([whether the target supports hidden visibility], + gcc_cv_have_attribute_visibility, [ + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void __attribute__((visibility("hidden"))) foo(void) { }]], [])], + gcc_cv_have_attribute_visibility=yes, + gcc_cv_have_attribute_visibility=no) + CFLAGS="$save_CFLAGS"]) + if test $gcc_cv_have_attribute_visibility = yes; then + AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1, + [Define to 1 if the target supports __attribute__((visibility(...))).]) + fi]) diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in index 887ae41e440..e7f12134ac5 100644 --- a/libatomic/Makefile.in +++ b/libatomic/Makefile.in @@ -115,6 +115,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/visibility.m4 \ $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ diff --git a/libatomic/acinclude.m4 b/libatomic/acinclude.m4 index 0ba6d8da23b..1e57bd52f5d 100644 --- a/libatomic/acinclude.m4 +++ b/libatomic/acinclude.m4 @@ -206,21 +206,6 @@ AC_DEFUN([LIBAT_CHECK_IFUNC], [ dnl ---------------------------------------------------------------------- dnl This whole bit snagged from libitm. -dnl Check whether the target supports hidden visibility. -AC_DEFUN([LIBAT_CHECK_ATTRIBUTE_VISIBILITY], [ - AC_CACHE_CHECK([whether the target supports hidden visibility], - libat_cv_have_attribute_visibility, [ - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror" - AC_TRY_COMPILE([void __attribute__((visibility("hidden"))) foo(void) { }], - [], libat_cv_have_attribute_visibility=yes, - libat_cv_have_attribute_visibility=no) - CFLAGS="$save_CFLAGS"]) - if test $libat_cv_have_attribute_visibility = yes; then - AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1, - [Define to 1 if the target supports __attribute__((visibility(...))).]) - fi]) - dnl Check whether the target supports dllexport AC_DEFUN([LIBAT_CHECK_ATTRIBUTE_DLLEXPORT], [ AC_CACHE_CHECK([whether the target supports dllexport], diff --git a/libatomic/aclocal.m4 b/libatomic/aclocal.m4 index 4d7c727d9d3..b6c44a23e3e 100644 --- a/libatomic/aclocal.m4 +++ b/libatomic/aclocal.m4 @@ -1198,6 +1198,7 @@ m4_include([../config/multi.m4]) m4_include([../config/override.m4]) m4_include([../config/stdint.m4]) m4_include([../config/toolexeclibdir.m4]) +m4_include([../config/visibility.m4]) m4_include([../config/warnings.m4]) m4_include([../ltoptions.m4]) m4_include([../ltsugar.m4]) diff --git a/libatomic/configure b/libatomic/configure index 2ab04c889a7..8284c81b1bb 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -15435,7 +15435,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports hidden visibility" >&5 $as_echo_n "checking whether the target supports hidden visibility... " >&6; } -if ${libat_cv_have_attribute_visibility+:} false; then : +if ${gcc_cv_have_attribute_visibility+:} false; then : $as_echo_n "(cached) " >&6 else @@ -15453,16 +15453,16 @@ main () } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - libat_cv_have_attribute_visibility=yes + gcc_cv_have_attribute_visibility=yes else - libat_cv_have_attribute_visibility=no + gcc_cv_have_attribute_visibility=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libat_cv_have_attribute_visibility" >&5 -$as_echo "$libat_cv_have_attribute_visibility" >&6; } - if test $libat_cv_have_attribute_visibility = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_attribute_visibility" >&5 +$as_echo "$gcc_cv_have_attribute_visibility" >&6; } + if test $gcc_cv_have_attribute_visibility = yes; then $as_echo "#define HAVE_ATTRIBUTE_VISIBILITY 1" >>confdefs.h diff --git a/libatomic/configure.ac b/libatomic/configure.ac index 4dc99e0f89d..98aade0dae2 100644 --- a/libatomic/configure.ac +++ b/libatomic/configure.ac @@ -256,7 +256,7 @@ case " $config_path " in esac # See what sort of export controls are available. -LIBAT_CHECK_ATTRIBUTE_VISIBILITY +GCC_CHECK_ATTRIBUTE_VISIBILITY LIBAT_CHECK_ATTRIBUTE_DLLEXPORT LIBAT_CHECK_ATTRIBUTE_ALIAS if test x$try_ifunc = xyes; then diff --git a/libatomic/testsuite/Makefile.in b/libatomic/testsuite/Makefile.in index 381bae19232..ba6fbf22f85 100644 --- a/libatomic/testsuite/Makefile.in +++ b/libatomic/testsuite/Makefile.in @@ -101,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/visibility.m4 \ $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in index 360187a10ce..566fbff6125 100644 --- a/libgfortran/Makefile.in +++ b/libgfortran/Makefile.in @@ -171,6 +171,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/ax_pthread.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/visibility.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/acx.m4 \ diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index 239ab714750..ad90c68fe59 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -31,21 +31,6 @@ AC_DEFUN([AC_LIBTOOL_DLOPEN]) AC_DEFUN([AC_PROG_LD]) ]) -dnl Check whether the target supports hidden visibility. -AC_DEFUN([LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY], [ - AC_CACHE_CHECK([whether the target supports hidden visibility], - libgfor_cv_have_attribute_visibility, [ - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void __attribute__((visibility("hidden"))) foo(void) { }]], [])], - libgfor_cv_have_attribute_visibility=yes, - libgfor_cv_have_attribute_visibility=no) - CFLAGS="$save_CFLAGS"]) - if test $libgfor_cv_have_attribute_visibility = yes; then - AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1, - [Define to 1 if the target supports __attribute__((visibility(...))).]) - fi]) - dnl Check whether the target supports symbol aliases. AC_DEFUN([LIBGFOR_CHECK_ATTRIBUTE_ALIAS], [ AC_CACHE_CHECK([whether the target supports symbol aliases], diff --git a/libgfortran/aclocal.m4 b/libgfortran/aclocal.m4 index 139c98a50a7..c1e2f6dc502 100644 --- a/libgfortran/aclocal.m4 +++ b/libgfortran/aclocal.m4 @@ -1178,6 +1178,7 @@ m4_include([../config/multi.m4]) m4_include([../config/override.m4]) m4_include([../config/stdint.m4]) m4_include([../config/toolexeclibdir.m4]) +m4_include([../config/visibility.m4]) m4_include([../ltoptions.m4]) m4_include([../ltsugar.m4]) m4_include([../ltversion.m4]) diff --git a/libgfortran/configure b/libgfortran/configure index 75cf47e3a19..4555f6f0cf6 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -32021,7 +32021,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports hidden visibility" >&5 $as_echo_n "checking whether the target supports hidden visibility... " >&6; } -if ${libgfor_cv_have_attribute_visibility+:} false; then : +if ${gcc_cv_have_attribute_visibility+:} false; then : $as_echo_n "(cached) " >&6 else @@ -32039,16 +32039,16 @@ main () } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - libgfor_cv_have_attribute_visibility=yes + gcc_cv_have_attribute_visibility=yes else - libgfor_cv_have_attribute_visibility=no + gcc_cv_have_attribute_visibility=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_attribute_visibility" >&5 -$as_echo "$libgfor_cv_have_attribute_visibility" >&6; } - if test $libgfor_cv_have_attribute_visibility = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_attribute_visibility" >&5 +$as_echo "$gcc_cv_have_attribute_visibility" >&6; } + if test $gcc_cv_have_attribute_visibility = yes; then $as_echo "#define HAVE_ATTRIBUTE_VISIBILITY 1" >>confdefs.h diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index da9ae604cab..ce64e97bcca 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -787,7 +787,7 @@ fi # Check out attribute support. -LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY +GCC_CHECK_ATTRIBUTE_VISIBILITY LIBGFOR_CHECK_ATTRIBUTE_ALIAS # Check out atomic builtins support. diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in index 07827630e8c..9d1b05243e0 100644 --- a/libgomp/Makefile.in +++ b/libgomp/Makefile.in @@ -136,6 +136,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/tls.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/visibility.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ diff --git a/libgomp/acinclude.m4 b/libgomp/acinclude.m4 index 94820595996..a174ff5881a 100644 --- a/libgomp/acinclude.m4 +++ b/libgomp/acinclude.m4 @@ -12,21 +12,6 @@ AC_DEFUN([LIBGOMP_CHECK_SYNC_BUILTINS], [ [Define to 1 if the target supports __sync_*_compare_and_swap]) fi]) -dnl Check whether the target supports hidden visibility. -AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY], [ - AC_CACHE_CHECK([whether the target supports hidden visibility], - libgomp_cv_have_attribute_visibility, [ - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror" - AC_TRY_COMPILE([void __attribute__((visibility("hidden"))) foo(void) { }], - [], libgomp_cv_have_attribute_visibility=yes, - libgomp_cv_have_attribute_visibility=no) - CFLAGS="$save_CFLAGS"]) - if test $libgomp_cv_have_attribute_visibility = yes; then - AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1, - [Define to 1 if the target supports __attribute__((visibility(...))).]) - fi]) - dnl Check whether the target supports dllexport AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT], [ AC_CACHE_CHECK([whether the target supports dllexport], diff --git a/libgomp/aclocal.m4 b/libgomp/aclocal.m4 index 94d1b0af125..1298ffaa398 100644 --- a/libgomp/aclocal.m4 +++ b/libgomp/aclocal.m4 @@ -1180,6 +1180,7 @@ m4_include([../config/multi.m4]) m4_include([../config/override.m4]) m4_include([../config/tls.m4]) m4_include([../config/toolexeclibdir.m4]) +m4_include([../config/visibility.m4]) m4_include([../ltoptions.m4]) m4_include([../ltsugar.m4]) m4_include([../ltversion.m4]) diff --git a/libgomp/configure b/libgomp/configure index 56cffe79634..6d3f9922f06 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -16319,7 +16319,7 @@ $as_echo "#define USE_EMUTLS 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports hidden visibility" >&5 $as_echo_n "checking whether the target supports hidden visibility... " >&6; } -if ${libgomp_cv_have_attribute_visibility+:} false; then : +if ${gcc_cv_have_attribute_visibility+:} false; then : $as_echo_n "(cached) " >&6 else @@ -16337,16 +16337,16 @@ main () } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - libgomp_cv_have_attribute_visibility=yes + gcc_cv_have_attribute_visibility=yes else - libgomp_cv_have_attribute_visibility=no + gcc_cv_have_attribute_visibility=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgomp_cv_have_attribute_visibility" >&5 -$as_echo "$libgomp_cv_have_attribute_visibility" >&6; } - if test $libgomp_cv_have_attribute_visibility = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_attribute_visibility" >&5 +$as_echo "$gcc_cv_have_attribute_visibility" >&6; } + if test $gcc_cv_have_attribute_visibility = yes; then $as_echo "#define HAVE_ATTRIBUTE_VISIBILITY 1" >>confdefs.h diff --git a/libgomp/configure.ac b/libgomp/configure.ac index 1730c62c74c..a7938beb1ca 100644 --- a/libgomp/configure.ac +++ b/libgomp/configure.ac @@ -325,7 +325,7 @@ GCC_CHECK_TLS GCC_CHECK_EMUTLS # See what sort of export controls are available. -LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY +GCC_CHECK_ATTRIBUTE_VISIBILITY LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT LIBGOMP_CHECK_ATTRIBUTE_ALIAS LIBGOMP_ENABLE_SYMVERS diff --git a/libgomp/testsuite/Makefile.in b/libgomp/testsuite/Makefile.in index 477bfdb83de..23533732373 100644 --- a/libgomp/testsuite/Makefile.in +++ b/libgomp/testsuite/Makefile.in @@ -103,6 +103,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/tls.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/visibility.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ diff --git a/libitm/Makefile.in b/libitm/Makefile.in index cbca7026760..8e324314246 100644 --- a/libitm/Makefile.in +++ b/libitm/Makefile.in @@ -110,6 +110,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/tls.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/visibility.m4 \ $(top_srcdir)/../config/weakref.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ diff --git a/libitm/acinclude.m4 b/libitm/acinclude.m4 index 73ab59927c0..89f99099a06 100644 --- a/libitm/acinclude.m4 +++ b/libitm/acinclude.m4 @@ -26,21 +26,6 @@ AC_DEFUN([LIBITM_CHECK_64BIT_SYNC_BUILTINS], [ [Define to 1 if the target supports 64-bit __sync_*_compare_and_swap]) fi]) -dnl Check whether the target supports hidden visibility. -AC_DEFUN([LIBITM_CHECK_ATTRIBUTE_VISIBILITY], [ - AC_CACHE_CHECK([whether the target supports hidden visibility], - libitm_cv_have_attribute_visibility, [ - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror" - AC_TRY_COMPILE([void __attribute__((visibility("hidden"))) foo(void) { }], - [], libitm_cv_have_attribute_visibility=yes, - libitm_cv_have_attribute_visibility=no) - CFLAGS="$save_CFLAGS"]) - if test $libitm_cv_have_attribute_visibility = yes; then - AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1, - [Define to 1 if the target supports __attribute__((visibility(...))).]) - fi]) - dnl Check whether the target supports dllexport AC_DEFUN([LIBITM_CHECK_ATTRIBUTE_DLLEXPORT], [ AC_CACHE_CHECK([whether the target supports dllexport], diff --git a/libitm/aclocal.m4 b/libitm/aclocal.m4 index 4cb1a5f9098..ef1d70abeb5 100644 --- a/libitm/aclocal.m4 +++ b/libitm/aclocal.m4 @@ -1202,6 +1202,7 @@ m4_include([../config/override.m4]) m4_include([../config/stdint.m4]) m4_include([../config/tls.m4]) m4_include([../config/toolexeclibdir.m4]) +m4_include([../config/visibility.m4]) m4_include([../config/weakref.m4]) m4_include([../ltoptions.m4]) m4_include([../ltsugar.m4]) diff --git a/libitm/configure b/libitm/configure index 0c82eba44a6..532a59e5d64 100755 --- a/libitm/configure +++ b/libitm/configure @@ -17324,7 +17324,7 @@ $as_echo "#define HAVE_TLS 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports hidden visibility" >&5 $as_echo_n "checking whether the target supports hidden visibility... " >&6; } -if ${libitm_cv_have_attribute_visibility+:} false; then : +if ${gcc_cv_have_attribute_visibility+:} false; then : $as_echo_n "(cached) " >&6 else @@ -17342,16 +17342,16 @@ main () } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - libitm_cv_have_attribute_visibility=yes + gcc_cv_have_attribute_visibility=yes else - libitm_cv_have_attribute_visibility=no + gcc_cv_have_attribute_visibility=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libitm_cv_have_attribute_visibility" >&5 -$as_echo "$libitm_cv_have_attribute_visibility" >&6; } - if test $libitm_cv_have_attribute_visibility = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_attribute_visibility" >&5 +$as_echo "$gcc_cv_have_attribute_visibility" >&6; } + if test $gcc_cv_have_attribute_visibility = yes; then $as_echo "#define HAVE_ATTRIBUTE_VISIBILITY 1" >>confdefs.h diff --git a/libitm/configure.ac b/libitm/configure.ac index 0b5f08b86e8..db5528a01a4 100644 --- a/libitm/configure.ac +++ b/libitm/configure.ac @@ -218,7 +218,7 @@ GCC_LINUX_FUTEX(:) GCC_CHECK_TLS # See what sort of export controls are available. -LIBITM_CHECK_ATTRIBUTE_VISIBILITY +GCC_CHECK_ATTRIBUTE_VISIBILITY LIBITM_CHECK_ATTRIBUTE_DLLEXPORT LIBITM_CHECK_ATTRIBUTE_ALIAS diff --git a/libitm/testsuite/Makefile.in b/libitm/testsuite/Makefile.in index 2e044633365..cd39def26b8 100644 --- a/libitm/testsuite/Makefile.in +++ b/libitm/testsuite/Makefile.in @@ -105,6 +105,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/tls.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/visibility.m4 \ $(top_srcdir)/../config/weakref.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \