Add -Wstack-usage to the gcc warning flags list, but only if using a sufficiently...
authorNick Clifton <nickc@redhat.com>
Tue, 22 Mar 2016 09:41:16 +0000 (09:41 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 22 Mar 2016 09:41:16 +0000 (09:41 +0000)
bfd * warning.m4 (GCC_WARN_CFLAGS): Only add -Wstack-usage if using a
sufficiently recent version of GCC.
* configure: Regenerate.

others * configure: Regenerate.

15 files changed:
bfd/ChangeLog
bfd/configure
bfd/warning.m4
binutils/ChangeLog
binutils/configure
gas/ChangeLog
gas/configure
gold/ChangeLog
gold/configure
gprof/ChangeLog
gprof/configure
ld/ChangeLog
ld/configure
opcodes/ChangeLog
opcodes/configure

index ffafbf631f65f7f4ee0e3dc7eedea662805a71a7..6e393a3216bc8d6f5ca410519204f32ef643be34 100644 (file)
@@ -1,3 +1,9 @@
+2016-03-22  Nick Clifton  <nickc@redhat.com>
+
+       * warning.m4 (GCC_WARN_CFLAGS): Only add -Wstack-usage if using a
+       sufficiently recent version of GCC.
+       * configure: Regenerate.
+
 2016-03-22  Alan Modra  <amodra@gmail.com>
 
        PR 19851
index de5f36d9e0b5c4a1245d1b9c65643daf9a8b5468..d03b9962bdeae76ea3ba582f4e67b42806c850b1 100755 (executable)
 # 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__
 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
@@ -12264,7 +12282,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
 
index 0e838f6951cd33aba6b16912a740fcd522e289e2..028d079202777eddc1be4b8e2851cd62f9ce9466 100644 (file)
@@ -21,9 +21,16 @@ AC_DEFUN([AM_BINUTILS_WARNINGS],[
 # 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.
 AC_EGREP_CPP([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow")
 
+# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC.
+AC_EGREP_CPP([^[0-4]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144")
+
+
 AC_ARG_ENABLE(werror,
   [  --enable-werror         treat compile warnings as errors],
   [case "${enableval}" in
@@ -49,7 +56,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
 
index 805c6d81385e6380f2ea910a72e02ec682174fe6..0694a58c5495ec133047d8f7d50e64abf6cd0edf 100644 (file)
@@ -1,3 +1,7 @@
+2016-03-22  Nick Clifton  <nickc@redhat.com>
+
+       * configure: Regenerate.
+
 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * readelf.c (decode_ARC_machine_flags): Handle nps400.
index a36b30b1ba73bca9998e42ce85c896c30d1e0b2f..6ff47084b5c0cda4988716b0e0a0b5e5644186f8 100755 (executable)
@@ -11941,7 +11941,10 @@ _ACEOF
 # 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__
 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
@@ -11982,7 +12000,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
 
index 25c0ee6f24cc078cdd0b9fe0302013056d6cd346..43e467e89c4b36f1a85f347c2009e968fe3c9fc1 100644 (file)
@@ -1,3 +1,7 @@
+2016-03-22  Nick Clifton  <nickc@redhat.com>
+
+       * configure: Regenerate.
+
 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * testsuite/gas/arc/nps400-0.d: New file.
index 6c4327929cb9442b9be454d8b495cbf631060663..11e6ed436a1d23f655866368fa24e86fedf2ce7a 100755 (executable)
@@ -11714,7 +11714,10 @@ using_cgen=no
 # 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__
 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
@@ -11755,7 +11773,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
 
index 0052c0bd4c88b45ddb25c905baea2e538bbd9807..c3b4577d022e6bcde8966d3e3096cbb3e4e598cc 100644 (file)
@@ -1,3 +1,7 @@
+2016-03-22  Nick Clifton  <nickc@redhat.com>
+
+       * configure: Regenerate.
+
 2016-03-21  Cary Coutant  <ccoutant@gmail.com>
 
        PR gold/19842
index 811a3704caead3801fb3e08bb83d9cb73bef7a26..7fe771c60d1019d63c792b18ea87ee09dd8b4f60 100755 (executable)
@@ -6687,7 +6687,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__
@@ -6701,6 +6704,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
@@ -6728,7 +6746,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
 
index a23abcc445a6367b3fbd1be5fca3dbc0e021b5c4..14b430d26a3859a45f8f599c44a8c92ceb67d350 100644 (file)
@@ -1,3 +1,7 @@
+2016-03-22  Nick Clifton  <nickc@redhat.com>
+
+       * configure: Regenerate.
+
 2016-01-17  Alan Modra  <amodra@gmail.com>
 
        * configure: Regenerate.
index 79813e0ec87bb69f2bba2b8642b9ce8d2a370e00..77bfe7febfb0fcbcaa3d53fe693f0d6567e78532 100755 (executable)
 # 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__
 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
@@ -12138,7 +12156,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
 
index eda1986bbed7c9f3e2d8a725044ad2af045a6caf..92a71b71f62fb08d98e010a8a1dd37509e81634e 100644 (file)
@@ -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.
index 4d8f237664e5b7695353ddad7ca42bd38653b81d..572faa7d18f7b83c94b6d343627ae903093e581a 100755 (executable)
 # 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__
 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
 
index 811450dfde9ffa6692994a2fc05a9018412e70c0..b0fec5e4a52a8eeaed98b11375e6a76d9491e2d0 100644 (file)
@@ -1,3 +1,7 @@
+2016-03-22  Nick Clifton  <nickc@redhat.com>
+
+       * configure: Regenerate.
+
 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * arc-nps400-tbl.h: New file.
index a130b8479367f9a02d4b566f07e1f4fd1480d566..da03f50817ca3dcbadc48c2878e76a93e367eebb 100755 (executable)
 # 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__
 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
@@ -11545,7 +11563,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
 
This page took 0.055575 seconds and 4 git commands to generate.