aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-05-25 15:07:15 +0930
committerAlan Modra <amodra@gmail.com>2018-05-25 15:26:47 +0930
commit629dabe3b731c6194499652301935f34c3c20e0c (patch)
tree41a6bd826719090a4c62a49d17ca3d96071913c3 /bfd
parentf9885f5602476e402626bf305d6bc328eaf626c3 (diff)
downloadgdb-629dabe3b731c6194499652301935f34c3c20e0c.zip
gdb-629dabe3b731c6194499652301935f34c3c20e0c.tar.gz
gdb-629dabe3b731c6194499652301935f34c3c20e0c.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rwxr-xr-xbfd/configure3
-rw-r--r--bfd/configure.ac3
3 files changed, 11 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f086ad5..88a64d6 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/configure b/bfd/configure
index 2f3dbe7..c5b6335 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -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
diff --git a/bfd/configure.ac b/bfd/configure.ac
index b320828..bb5c168 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -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.])