The visibility attribute was actually added in gcc 3.3.x, not 4.0.

Just assume that if -fvisibility=hidden works that the attribute
is usable.
This commit is contained in:
Todd C. Miller
2012-06-13 16:57:49 -04:00
parent 649edc3192
commit 1fe3f9f40f
4 changed files with 9 additions and 1 deletions

View File

@@ -115,6 +115,9 @@
/* Define to 1 if you have the `dlopen' function. */
#undef HAVE_DLOPEN
/* Define to 1 if the compiler supports the __visibility__ attribute. */
#undef HAVE_DSO_VISIBILITY
/* Define to 1 if your system has the F_CLOSEM fcntl. */
#undef HAVE_FCNTL_CLOSEM

3
configure vendored
View File

@@ -20110,6 +20110,8 @@ eval ac_res=\$$as_CACHEVAR
$as_echo "$ac_res" >&6; }
if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
$as_echo "#define HAVE_DSO_VISIBILITY 1" >>confdefs.h
CFLAGS="${CFLAGS} -fvisibility=hidden"
LTEXP="#"
@@ -22740,5 +22742,6 @@ fi

View File

@@ -3173,6 +3173,7 @@ dnl into fatal errors (and there is no way to undo that)
dnl
AC_LANG_WERROR
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [
AC_DEFINE(HAVE_DSO_VISIBILITY)
CFLAGS="${CFLAGS} -fvisibility=hidden"
LTEXP="#"
])
@@ -3460,6 +3461,7 @@ AH_TEMPLATE(RTLD_PRELOAD_VAR, [The environment variable that controls preloading
AH_TEMPLATE(RTLD_PRELOAD_ENABLE_VAR, [An extra environment variable that is required to enable preloading (if any).])
AH_TEMPLATE(RTLD_PRELOAD_DELIM, [The delimiter to use when defining multiple preloaded objects.])
AH_TEMPLATE(RTLD_PRELOAD_DEFAULT, [The default value of preloaded objects (if any).])
AH_TEMPLATE(HAVE_DSO_VISIBILITY, [Define to 1 if the compiler supports the __visibility__ attribute.])
dnl
dnl Bits to copy verbatim into config.h.in

View File

@@ -53,7 +53,7 @@
#endif
#ifndef __dso_public
# if __GNUC_PREREQ__(4, 0)
# ifdef HAVE_DSO_VISIBILITY
# define __dso_public __attribute__((__visibility__("default")))
# define __dso_hidden __attribute__((__visibility__("hidden")))
# else