Fix hidden visibility compiler test

Warnings from configure tests aren't usually checked.  gcc's
"visibility attribute not supported in this configuration" warning is
enabled by default so we don't need to add any warning flag except
-Werror.

	* configure.ac (bfd_cv_hidden): Run test with -Werror in CFLAGS.
	* configure: Regenerate.
This commit is contained in:
Alan Modra 2018-05-25 15:07:15 +09:30
parent f9885f5602
commit 629dabe3b7
3 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2018-05-25 Alan Modra <amodra@gmail.com>
* configure.ac (bfd_cv_hidden): Run test with -Werror in CFLAGS.
* configure: Regenerate.
2018-05-23 H.J. Lu <hongjiu.lu@intel.com>
* elf64-ppc.c (ppc64_elf_write_core_note): Add ATTRIBUTE_NONSTRING

3
bfd/configure vendored
View File

@ -14043,6 +14043,8 @@ fi
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler support for hidden visibility" >&5
$as_echo_n "checking compiler support for hidden visibility... " >&6; }
if test "${bfd_cv_hidden+set}" = set; then :
@ -14070,6 +14072,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_hidden" >&5
$as_echo "$bfd_cv_hidden" >&6; }
CFLAGS="$save_CFLAGS"
if test $bfd_cv_hidden = yes; then
$as_echo "#define HAVE_HIDDEN 1" >>confdefs.h

View File

@ -256,12 +256,15 @@ AC_CHECK_DECLS(strnlen)
# This is used only by compress.c.
AM_ZLIB
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
AC_CACHE_CHECK([compiler support for hidden visibility], bfd_cv_hidden,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
const char hw[] __attribute__ ((__visibility__ ("hidden"))) = "Hello, World\n";
extern void print (const char *) __attribute__ ((__visibility__ ("hidden")));]],
[[print (hw);]])],
[bfd_cv_hidden=yes], [bfd_cv_hidden=no])])
CFLAGS="$save_CFLAGS"
if test $bfd_cv_hidden = yes; then
AC_DEFINE(HAVE_HIDDEN, 1,
[Define if your compiler supports hidden visibility.])