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:
parent
f9885f5602
commit
629dabe3b7
@ -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
3
bfd/configure
vendored
@ -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
|
||||
|
@ -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.])
|
||||
|
Loading…
x
Reference in New Issue
Block a user