[PATCH 19/20] Configure for hidden aliases.

Richard Henderson rth at twiddle.net
Mon Mar 4 19:41:49 CET 2013


---
 acinclude.m4 | 20 ++++++++++++++++++++
 config.in    |  4 ++++
 configure.ac |  1 +
 3 files changed, 25 insertions(+)

diff --git a/acinclude.m4 b/acinclude.m4
index 15f71b1..f7b128e 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -3169,6 +3169,26 @@ fi
 ])
 
 
+dnl  GMP_C_HIDDEN_ALIAS
+dnl  ------------------------
+
+AC_DEFUN([GMP_C_HIDDEN_ALIAS],
+[AC_CACHE_CHECK([whether gcc hidden aliases work],
+                gmp_cv_c_hidden_alias,
+[AC_TRY_COMPILE(
+[void bar(int y)  { }
+extern void foo (int x) __attribute__ ((visibility("hidden"), alias("bar")));],
+, gmp_cv_c_hidden_alias=yes, gmp_cv_c_hidden_alias=no)
+])
+if test $gmp_cv_c_hidden_alias = yes; then
+  AC_DEFINE(HAVE_HIDDEN_ALIAS, 1,
+  [Define to 1 if the compiler accepts gcc style __attribute__ ((visibility))
+and __attribute__ ((alias))])
+  GMP_DEFINE(HAVE_HIDDEN_ALIAS, [])
+fi
+])
+
+
 dnl  GMP_C_DOUBLE_FORMAT
 dnl  -------------------
 dnl  Determine the floating point format.
diff --git a/config.in b/config.in
index 944383e..60ea30d 100644
--- a/config.in
+++ b/config.in
@@ -128,6 +128,10 @@ along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((visibility))
+   and __attribute__ ((alias)) */
+#undef HAVE_HIDDEN_ALIAS
+
 /* Define one of these to 1 for the host CPU family.
    If your CPU is not in any of these families, leave all undefined.
    For an AMD64 chip, define "x86" in ABI=32, but not in ABI=64. */
diff --git a/configure.ac b/configure.ac
index 189363f..9a805cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2580,6 +2580,7 @@ GMP_C_ATTRIBUTE_CONST
 GMP_C_ATTRIBUTE_MALLOC
 GMP_C_ATTRIBUTE_MODE
 GMP_C_ATTRIBUTE_NORETURN
+GMP_C_HIDDEN_ALIAS
 
 GMP_H_EXTERN_INLINE
 
-- 
1.8.1.2



More information about the gmp-devel mailing list