aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-03-22 09:41:16 +0000
committerNick Clifton <nickc@redhat.com>2016-03-22 09:41:16 +0000
commit9780e045073b1719a7a4c6cbe00e4aa7525bd180 (patch)
tree3def78d7a5256187ded65f646443c1d13101d0a3 /ld
parent648c5cbbf34dcbf96bde7e07b14868777fd5d635 (diff)
downloadgdb-9780e045073b1719a7a4c6cbe00e4aa7525bd180.zip
gdb-9780e045073b1719a7a4c6cbe00e4aa7525bd180.tar.gz
gdb-9780e045073b1719a7a4c6cbe00e4aa7525bd180.tar.bz2
Add -Wstack-usage to the gcc warning flags list, but only if using a sufficiently recent version of gcc.
bfd * warning.m4 (GCC_WARN_CFLAGS): Only add -Wstack-usage if using a sufficiently recent version of GCC. * configure: Regenerate. others * configure: Regenerate.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog4
-rwxr-xr-xld/configure20
2 files changed, 23 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index eda1986..92a71b7 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,7 @@
+2016-03-22 Nick Clifton <nickc@redhat.com>
+
+ * configure: Regenerate.
+
2016-03-21 Nick Clifton <nickc@redhat.com>
* emultempl/msp430.em: Replace use of alloca with call to xmalloc.
diff --git a/ld/configure b/ld/configure
index 4d8f237..572faa7 100755
--- a/ld/configure
+++ b/ld/configure
@@ -15540,7 +15540,10 @@ fi
# Set the 'development' global.
. $srcdir/../bfd/development.sh
+# Default set of GCC warnings to enable.
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+
+# Add -Wshadow if the compiler is a sufficiently recent version of GCC.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
__GNUC__
@@ -15554,6 +15557,21 @@ fi
rm -f conftest*
+# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+__GNUC__
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "^[0-4]$" >/dev/null 2>&1; then :
+
+else
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144"
+fi
+rm -f conftest*
+
+
+
# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then :
enableval=$enable_werror; case "${enableval}" in
@@ -15581,7 +15599,7 @@ fi
NO_WERROR=
if test "${ERROR_ON_WARNING}" = yes ; then
- GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror -Wstack-usage=262144"
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror"
NO_WERROR="-Wno-error"
fi