From c5da193232ea0452f714dffee0d417d965590476 Mon Sep 17 00:00:00 2001 From: Vlad Zakharov Date: Mon, 26 Sep 2016 16:36:08 +0100 Subject: [PATCH] When building target binaries, ensure that the warning flags selected for the command line match the target compiler. bfd * warning.m4 (AC_EGREP_CPP_FOR_BUILD): Introduce macro to verify CC_FOR_BUILD compiler. (AM_BINUTILS_WARNINGS): Introduce ac_cpp_for_build variable and add CC_FOR_BUILD compiler checks. * Makefile.in: Regenerate. * configure: Likewise. * doc/Makefile.in: Likewise. binutils * Makefile.am: Replace AM_CLFAGS with AM_CFLAGS_FOR_BUILD when building with CC_FOR_BUILD compiler. * Makefile.in: Regenerate. * configure: Likewise. * doc/Makefile.in: Likewise. gas * Makefile.in: Regenerate. * configure: Likewise. * doc/Makefile.in: Likewise. gold * Makefile.in: Regenerate. * configure: Likewise. * testsuite/Makefile.in: Likewise. gprof * Makefile.in: Regenerate. * configure: Likewise. ld * Makefile.in: Regenerate. * configure: Likewise. opcodes * Makefile.in: Regenerate. * configure: Likewise. --- bfd/ChangeLog | 10 +++++++ bfd/Makefile.in | 1 + bfd/configure | 56 ++++++++++++++++++++++++++++++++++---- bfd/doc/Makefile.in | 1 + bfd/warning.m4 | 47 +++++++++++++++++++++++++++++--- binutils/ChangeLog | 8 ++++++ binutils/Makefile.am | 10 ++++--- binutils/Makefile.in | 10 ++++--- binutils/configure | 56 ++++++++++++++++++++++++++++++++++---- binutils/doc/Makefile.in | 1 + gas/ChangeLog | 6 ++++ gas/Makefile.in | 1 + gas/configure | 56 ++++++++++++++++++++++++++++++++++---- gas/doc/Makefile.in | 1 + gold/ChangeLog | 6 ++++ gold/Makefile.in | 5 ++-- gold/configure | 52 ++++++++++++++++++++++++++++++++--- gold/testsuite/Makefile.in | 1 + gprof/ChangeLog | 5 ++++ gprof/Makefile.in | 1 + gprof/configure | 56 ++++++++++++++++++++++++++++++++++---- ld/ChangeLog | 5 ++++ ld/Makefile.in | 3 +- ld/configure | 56 ++++++++++++++++++++++++++++++++++---- opcodes/ChangeLog | 5 ++++ opcodes/Makefile.in | 1 + opcodes/configure | 56 ++++++++++++++++++++++++++++++++++---- 27 files changed, 461 insertions(+), 55 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ce0670244d8..b95d68ca621 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +2016-09-26 Vlad Zakharov + + * warning.m4 (AC_EGREP_CPP_FOR_BUILD): Introduce macro + to verify CC_FOR_BUILD compiler. + (AM_BINUTILS_WARNINGS): Introduce ac_cpp_for_build variable + and add CC_FOR_BUILD compiler checks. + * Makefile.in: Regenerate. + * configure: Likewise. + * doc/Makefile.in: Likewise. + 2016-09-26 Awson PR ld/17955 diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 7283ed95b48..02332ca9f29 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -288,6 +288,7 @@ TDEFINES = @TDEFINES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ diff --git a/bfd/configure b/bfd/configure index 3e033247c3c..828406952fb 100755 --- a/bfd/configure +++ b/bfd/configure @@ -659,6 +659,7 @@ MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE WARN_WRITE_STRINGS NO_WERROR +WARN_CFLAGS_FOR_BUILD WARN_CFLAGS REPORT_BUGS_TEXI REPORT_BUGS_TO @@ -11427,7 +11428,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11430 "configure" +#line 11431 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11533,7 +11534,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11536 "configure" +#line 11537 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12240,8 +12241,12 @@ fi # Set the 'development' global. . $srcdir/../bfd/development.sh +# Set acp_cpp_for_build variable +ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" + # Default set of GCC warnings to enable. GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" +GCC_WARN_CFLAGS_FOR_BUILD="-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 @@ -12286,6 +12291,36 @@ fi rm -f conftest* +# Verify CC_FOR_BUILD to be compatible with waring flags + +# Add -Wshadow 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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-3]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" +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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-4]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -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 @@ -12301,6 +12336,7 @@ case "${host}" in *-*-mingw32*) if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" fi ;; *) ;; @@ -12314,25 +12350,32 @@ fi NO_WERROR= if test "${ERROR_ON_WARNING}" = yes ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" NO_WERROR="-Wno-error" fi if test "${GCC}" = yes ; then WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" fi # Check whether --enable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then : enableval=$enable_build_warnings; case "${enableval}" in - yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; no) if test "${GCC}" = yes ; then WARN_CFLAGS="-w" + WARN_CFLAGS_FOR_BUILD="-w" fi;; ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; + *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac fi @@ -12346,6 +12389,7 @@ fi + ac_config_headers="$ac_config_headers config.h:config.in" diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in index be737f67fc0..b992872aa48 100644 --- a/bfd/doc/Makefile.in +++ b/bfd/doc/Makefile.in @@ -248,6 +248,7 @@ TDEFINES = @TDEFINES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ diff --git a/bfd/warning.m4 b/bfd/warning.m4 index 4c5b55d1f8c..3fe4340e7cb 100644 --- a/bfd/warning.m4 +++ b/bfd/warning.m4 @@ -17,12 +17,34 @@ dnl along with this program; see the file COPYING3. If not see dnl . dnl +# AC_EGREP_CPP_FOR_BUILD(PATTERN, PROGRAM, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------------------ +AC_DEFUN([AC_EGREP_CPP_FOR_BUILD], +[AC_LANG_PREPROC_REQUIRE()dnl +AC_REQUIRE([AC_PROG_EGREP])dnl +AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) +AS_IF([dnl eval is necessary to expand ac_cpp. +dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. +(eval "$ac_cpp_for_build conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | +dnl Quote $1 to prevent m4 from eating character classes + $EGREP "[$1]" >/dev/null 2>&1], + [$3], + [$4]) +rm -f conftest* +])# AC_EGREP_CPP_FOR_BUILD + + AC_DEFUN([AM_BINUTILS_WARNINGS],[ # Set the 'development' global. . $srcdir/../bfd/development.sh +# Set acp_cpp_for_build variable +ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" + # Default set of GCC warnings to enable. GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" +GCC_WARN_CFLAGS_FOR_BUILD="-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") @@ -34,6 +56,14 @@ AC_EGREP_CPP([^[0-4]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usa WARN_WRITE_STRINGS="" AC_EGREP_CPP([^[0-3]$],[__GNUC__],,WARN_WRITE_STRINGS="-Wwrite-strings") +# Verify CC_FOR_BUILD to be compatible with waring flags + +# Add -Wshadow if the compiler is a sufficiently recent version of GCC. +AC_EGREP_CPP_FOR_BUILD([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow") + +# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. +AC_EGREP_CPP_FOR_BUILD([^[0-4]$],[__GNUC__],,GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144") + AC_ARG_ENABLE(werror, [ --enable-werror treat compile warnings as errors], [case "${enableval}" in @@ -47,6 +77,7 @@ case "${host}" in *-*-mingw32*) if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" fi ;; *) ;; @@ -60,25 +91,32 @@ fi NO_WERROR= if test "${ERROR_ON_WARNING}" = yes ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" NO_WERROR="-Wno-error" fi if test "${GCC}" = yes ; then WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" fi AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings enable build-time compiler warnings], [case "${enableval}" in - yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; no) if test "${GCC}" = yes ; then WARN_CFLAGS="-w" + WARN_CFLAGS_FOR_BUILD="-w" fi;; ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; + *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac]) if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then @@ -86,6 +124,7 @@ if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then fi AC_SUBST(WARN_CFLAGS) +AC_SUBST(WARN_CFLAGS_FOR_BUILD) AC_SUBST(NO_WERROR) AC_SUBST(WARN_WRITE_STRINGS) ]) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 0b4d1a57034..1b9cb24a1ee 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,11 @@ +2016-09-26 Vlad Zakharov + + * Makefile.am: Replace AM_CLFAGS with AM_CFLAGS_FOR_BUILD + when building with CC_FOR_BUILD compiler. + * Makefile.in: Regenerate. + * configure: Likewise. + * doc/Makefile.in: Likewise. + 2016-09-26 Alan Modra * readelf.c (display_power_gnu_attribute): Catch truncated section diff --git a/binutils/Makefile.am b/binutils/Makefile.am index 18af2c886bc..ef179147dcd 100644 --- a/binutils/Makefile.am +++ b/binutils/Makefile.am @@ -47,8 +47,10 @@ ZLIB = @zlibdir@ -lz ZLIBINC = @zlibinc@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ NO_WERROR = @NO_WERROR@ AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) +AM_CFLAGS_FOR_BUILD = $(WARN_CFLAGS_FOR_BUILD) $(ZLIBINC) LIBICONV = @LIBICONV@ # these two are almost the same program @@ -305,17 +307,17 @@ sysinfo$(EXEEXT_FOR_BUILD): sysinfo.@OBJEXT@ syslex_wrap.@OBJEXT@ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.@OBJEXT@ syslex_wrap.@OBJEXT@ syslex_wrap.@OBJEXT@: syslex_wrap.c syslex.c sysinfo.h config.h - $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex_wrap.c + $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex_wrap.c sysinfo.@OBJEXT@: sysinfo.c if [ -r sysinfo.c ]; then \ - $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \ + $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \ else \ - $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \ + $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \ fi bin2c$(EXEEXT_FOR_BUILD): bin2c.c - $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c + $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c embedspu: embedspu.sh Makefile awk '/^program_transform_name=/ {print "program_transform_name=\"$(program_transform_name)\""; next} {print}' < $< > $@ diff --git a/binutils/Makefile.in b/binutils/Makefile.in index 215ff702f0c..5b62333d69f 100644 --- a/binutils/Makefile.in +++ b/binutils/Makefile.in @@ -401,6 +401,7 @@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi` @@ -478,6 +479,7 @@ am__skipyacc = ZLIB = @zlibdir@ -lz ZLIBINC = @zlibinc@ AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) +AM_CFLAGS_FOR_BUILD = $(WARN_CFLAGS_FOR_BUILD) $(ZLIBINC) # these two are almost the same program AR_PROG = ar @@ -1370,17 +1372,17 @@ sysinfo$(EXEEXT_FOR_BUILD): sysinfo.@OBJEXT@ syslex_wrap.@OBJEXT@ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.@OBJEXT@ syslex_wrap.@OBJEXT@ syslex_wrap.@OBJEXT@: syslex_wrap.c syslex.c sysinfo.h config.h - $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex_wrap.c + $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex_wrap.c sysinfo.@OBJEXT@: sysinfo.c if [ -r sysinfo.c ]; then \ - $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \ + $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \ else \ - $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \ + $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \ fi bin2c$(EXEEXT_FOR_BUILD): bin2c.c - $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c + $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c embedspu: embedspu.sh Makefile awk '/^program_transform_name=/ {print "program_transform_name=\"$(program_transform_name)\""; next} {print}' < $< > $@ diff --git a/binutils/configure b/binutils/configure index 79dcbd008e8..610d07ebdc2 100755 --- a/binutils/configure +++ b/binutils/configure @@ -652,6 +652,7 @@ YFLAGS YACC WARN_WRITE_STRINGS NO_WERROR +WARN_CFLAGS_FOR_BUILD WARN_CFLAGS OTOOL64 OTOOL @@ -11225,7 +11226,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11228 "configure" +#line 11229 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11331,7 +11332,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11334 "configure" +#line 11335 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11945,8 +11946,12 @@ _ACEOF # Set the 'development' global. . $srcdir/../bfd/development.sh +# Set acp_cpp_for_build variable +ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" + # Default set of GCC warnings to enable. GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" +GCC_WARN_CFLAGS_FOR_BUILD="-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 @@ -11991,6 +11996,36 @@ fi rm -f conftest* +# Verify CC_FOR_BUILD to be compatible with waring flags + +# Add -Wshadow 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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-3]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" +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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-4]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -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 @@ -12006,6 +12041,7 @@ case "${host}" in *-*-mingw32*) if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" fi ;; *) ;; @@ -12019,25 +12055,32 @@ fi NO_WERROR= if test "${ERROR_ON_WARNING}" = yes ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" NO_WERROR="-Wno-error" fi if test "${GCC}" = yes ; then WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" fi # Check whether --enable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then : enableval=$enable_build_warnings; case "${enableval}" in - yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; no) if test "${GCC}" = yes ; then WARN_CFLAGS="-w" + WARN_CFLAGS_FOR_BUILD="-w" fi;; ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; + *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac fi @@ -12051,6 +12094,7 @@ fi + ac_config_headers="$ac_config_headers config.h:config.in" diff --git a/binutils/doc/Makefile.in b/binutils/doc/Makefile.in index ea3f938ead3..8d9fc2df9b7 100644 --- a/binutils/doc/Makefile.in +++ b/binutils/doc/Makefile.in @@ -249,6 +249,7 @@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ diff --git a/gas/ChangeLog b/gas/ChangeLog index f5f22989433..3d6bf9440d6 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2016-09-26 Vlad Zakharov + + * Makefile.in: Regenerate. + * configure: Likewise. + * doc/Makefile.in: Likewise. + 2016-09-26 Alan Modra * config/tc-ppc.c (ppc_elf_gnu_attribute): New function. diff --git a/gas/Makefile.in b/gas/Makefile.in index 19b63f36c17..6896609ed32 100644 --- a/gas/Makefile.in +++ b/gas/Makefile.in @@ -255,6 +255,7 @@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ @WARN_WRITE_STRINGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi` diff --git a/gas/configure b/gas/configure index 29ec28e9661..6fae0d9d705 100755 --- a/gas/configure +++ b/gas/configure @@ -642,6 +642,7 @@ cgen_cpu_prefix GDBINIT WARN_WRITE_STRINGS NO_WERROR +WARN_CFLAGS_FOR_BUILD WARN_CFLAGS OTOOL64 OTOOL @@ -10985,7 +10986,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10988 "configure" +#line 10989 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11091,7 +11092,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11094 "configure" +#line 11095 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11721,8 +11722,12 @@ using_cgen=no # Set the 'development' global. . $srcdir/../bfd/development.sh +# Set acp_cpp_for_build variable +ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" + # Default set of GCC warnings to enable. GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" +GCC_WARN_CFLAGS_FOR_BUILD="-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 @@ -11767,6 +11772,36 @@ fi rm -f conftest* +# Verify CC_FOR_BUILD to be compatible with waring flags + +# Add -Wshadow 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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-3]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" +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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-4]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -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 @@ -11782,6 +11817,7 @@ case "${host}" in *-*-mingw32*) if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" fi ;; *) ;; @@ -11795,25 +11831,32 @@ fi NO_WERROR= if test "${ERROR_ON_WARNING}" = yes ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" NO_WERROR="-Wno-error" fi if test "${GCC}" = yes ; then WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" fi # Check whether --enable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then : enableval=$enable_build_warnings; case "${enableval}" in - yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; no) if test "${GCC}" = yes ; then WARN_CFLAGS="-w" + WARN_CFLAGS_FOR_BUILD="-w" fi;; ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; + *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac fi @@ -11827,6 +11870,7 @@ fi + # Generate a header file ac_config_headers="$ac_config_headers config.h:config.in" diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in index 9ca5e8e8561..5f09b6c5812 100644 --- a/gas/doc/Makefile.in +++ b/gas/doc/Makefile.in @@ -230,6 +230,7 @@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ diff --git a/gold/ChangeLog b/gold/ChangeLog index 6939b5ba4e2..d791d2940f2 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2016-09-26 Vlad Zakharov + + * Makefile.in: Regenerate. + * configure: Likewise. + * testsuite/Makefile.in: Likewise. + 2016-09-26 Alan Modra * aarch64.cc (Target_aarch64::is_erratum_835769_sequence): Avoid diff --git a/gold/Makefile.in b/gold/Makefile.in index ec674485af0..98ab28e0b64 100644 --- a/gold/Makefile.in +++ b/gold/Makefile.in @@ -87,8 +87,8 @@ subdir = . DIST_COMMON = NEWS README ChangeLog $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(srcdir)/config.in \ - $(srcdir)/../mkinstalldirs $(top_srcdir)/po/Make-in \ - ftruncate.c pread.c mremap.c ffsll.c yyscript.h yyscript.c \ + $(srcdir)/../mkinstalldirs $(top_srcdir)/po/Make-in ffsll.c \ + mremap.c ftruncate.c pread.c yyscript.h yyscript.c \ $(srcdir)/../depcomp $(srcdir)/../ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ @@ -409,6 +409,7 @@ TARGETOBJS = @TARGETOBJS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ WARN_CXXFLAGS = @WARN_CXXFLAGS@ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ diff --git a/gold/configure b/gold/configure index 8240c28a91e..343a407c112 100755 --- a/gold/configure +++ b/gold/configure @@ -609,6 +609,7 @@ GOLD_LDFLAGS WARN_CXXFLAGS WARN_WRITE_STRINGS NO_WERROR +WARN_CFLAGS_FOR_BUILD WARN_CFLAGS IFUNC_STATIC_FALSE IFUNC_STATIC_TRUE @@ -6723,8 +6724,12 @@ fi # Set the 'development' global. . $srcdir/../bfd/development.sh +# Set acp_cpp_for_build variable +ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" + # Default set of GCC warnings to enable. GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" +GCC_WARN_CFLAGS_FOR_BUILD="-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 @@ -6769,6 +6774,36 @@ fi rm -f conftest* +# Verify CC_FOR_BUILD to be compatible with waring flags + +# Add -Wshadow 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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-3]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" +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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-4]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -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 @@ -6784,6 +6819,7 @@ case "${host}" in *-*-mingw32*) if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" fi ;; *) ;; @@ -6797,25 +6833,32 @@ fi NO_WERROR= if test "${ERROR_ON_WARNING}" = yes ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" NO_WERROR="-Wno-error" fi if test "${GCC}" = yes ; then WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" fi # Check whether --enable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then : enableval=$enable_build_warnings; case "${enableval}" in - yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; no) if test "${GCC}" = yes ; then WARN_CFLAGS="-w" + WARN_CFLAGS_FOR_BUILD="-w" fi;; ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; + *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac fi @@ -6829,6 +6872,7 @@ fi + WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//' -e 's/-Wshadow//'` diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in index f55aee8e04a..a2005407b64 100644 --- a/gold/testsuite/Makefile.in +++ b/gold/testsuite/Makefile.in @@ -2588,6 +2588,7 @@ TARGETOBJS = @TARGETOBJS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ WARN_CXXFLAGS = @WARN_CXXFLAGS@ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ diff --git a/gprof/ChangeLog b/gprof/ChangeLog index 176a8f9ab5c..6e6fd67026b 100644 --- a/gprof/ChangeLog +++ b/gprof/ChangeLog @@ -1,3 +1,8 @@ +2016-09-26 Vlad Zakharov + + * Makefile.in: Regenerate. + * configure: Likewise. + 2016-08-30 Nick Clifton PR gprof/20499 diff --git a/gprof/Makefile.in b/gprof/Makefile.in index 67e85cd7ec4..b1b357c2cf5 100644 --- a/gprof/Makefile.in +++ b/gprof/Makefile.in @@ -267,6 +267,7 @@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ diff --git a/gprof/configure b/gprof/configure index 431f7b8212f..97363ee8616 100755 --- a/gprof/configure +++ b/gprof/configure @@ -604,6 +604,7 @@ LTLIBOBJS LIBOBJS WARN_WRITE_STRINGS NO_WERROR +WARN_CFLAGS_FOR_BUILD WARN_CFLAGS GENINSRC_NEVER_FALSE GENINSRC_NEVER_TRUE @@ -10901,7 +10902,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10904 "configure" +#line 10905 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11007,7 +11008,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11010 "configure" +#line 11011 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12101,8 +12102,12 @@ fi # Set the 'development' global. . $srcdir/../bfd/development.sh +# Set acp_cpp_for_build variable +ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" + # Default set of GCC warnings to enable. GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" +GCC_WARN_CFLAGS_FOR_BUILD="-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 @@ -12147,6 +12152,36 @@ fi rm -f conftest* +# Verify CC_FOR_BUILD to be compatible with waring flags + +# Add -Wshadow 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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-3]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" +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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-4]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -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 @@ -12162,6 +12197,7 @@ case "${host}" in *-*-mingw32*) if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" fi ;; *) ;; @@ -12175,25 +12211,32 @@ fi NO_WERROR= if test "${ERROR_ON_WARNING}" = yes ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" NO_WERROR="-Wno-error" fi if test "${GCC}" = yes ; then WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" fi # Check whether --enable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then : enableval=$enable_build_warnings; case "${enableval}" in - yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; no) if test "${GCC}" = yes ; then WARN_CFLAGS="-w" + WARN_CFLAGS_FOR_BUILD="-w" fi;; ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; + *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac fi @@ -12212,6 +12255,7 @@ fi + ac_config_files="$ac_config_files Makefile po/Makefile.in:po/Make-in" cat >confcache <<\_ACEOF diff --git a/ld/ChangeLog b/ld/ChangeLog index 3f43b6439de..1a443bcc5e0 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2016-09-26 Vlad Zakharov + + * Makefile.in: Regenerate. + * configure: Likewise. + 2016-09-26 Alan Modra * testsuite/ld-powerpc/attr-gnu-4-4.s: Delete. diff --git a/ld/Makefile.in b/ld/Makefile.in index 48b7ba73bb9..3511e5f1208 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -354,6 +354,7 @@ TESTBFDLIB = @TESTBFDLIB@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi` @@ -508,7 +509,7 @@ CXX_FOR_TARGET = ` \ fi` -# Strip out sanitization options as they require special host libraries. +# Strip out sanitization options as we want to test building binaries without any extra paraphernalia CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` info_TEXINFOS = ld.texinfo diff --git a/ld/configure b/ld/configure index 6adc94da0b0..3f82f35fdd9 100755 --- a/ld/configure +++ b/ld/configure @@ -646,6 +646,7 @@ LIBINTL USE_NLS WARN_WRITE_STRINGS NO_WERROR +WARN_CFLAGS_FOR_BUILD WARN_CFLAGS installed_linker install_as_default @@ -11723,7 +11724,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11726 "configure" +#line 11727 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11829,7 +11830,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11832 "configure" +#line 11833 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15558,8 +15559,12 @@ fi # Set the 'development' global. . $srcdir/../bfd/development.sh +# Set acp_cpp_for_build variable +ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" + # Default set of GCC warnings to enable. GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" +GCC_WARN_CFLAGS_FOR_BUILD="-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 @@ -15604,6 +15609,36 @@ fi rm -f conftest* +# Verify CC_FOR_BUILD to be compatible with waring flags + +# Add -Wshadow 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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-3]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" +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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-4]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -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 @@ -15619,6 +15654,7 @@ case "${host}" in *-*-mingw32*) if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" fi ;; *) ;; @@ -15632,25 +15668,32 @@ fi NO_WERROR= if test "${ERROR_ON_WARNING}" = yes ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" NO_WERROR="-Wno-error" fi if test "${GCC}" = yes ; then WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" fi # Check whether --enable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then : enableval=$enable_build_warnings; case "${enableval}" in - yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; no) if test "${GCC}" = yes ; then WARN_CFLAGS="-w" + WARN_CFLAGS_FOR_BUILD="-w" fi;; ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; + *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac fi @@ -15665,6 +15708,7 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 $as_echo_n "checking for LC_MESSAGES... " >&6; } if test "${am_cv_val_LC_MESSAGES+set}" = set; then : diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 282b4768dfd..1613154249b 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2016-09-26 Vlad Zakharov + + * Makefile.in: Regenerate. + * configure: Likewise. + 2016-09-26 Claudiu Zissulescu * arc-ext-tbl.h (EXTINSN2OPF): Define. diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in index 80cef601e9d..44e5c04ce80 100644 --- a/opcodes/Makefile.in +++ b/opcodes/Makefile.in @@ -267,6 +267,7 @@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ diff --git a/opcodes/configure b/opcodes/configure index 252ab2f397e..031da2fa9ca 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -643,6 +643,7 @@ MAINTAINER_MODE_TRUE NO_WMISSING_FIELD_INITIALIZERS WARN_WRITE_STRINGS NO_WERROR +WARN_CFLAGS_FOR_BUILD WARN_CFLAGS OTOOL64 OTOOL @@ -11150,7 +11151,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11153 "configure" +#line 11154 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11256,7 +11257,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11259 "configure" +#line 11260 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11508,8 +11509,12 @@ fi # Set the 'development' global. . $srcdir/../bfd/development.sh +# Set acp_cpp_for_build variable +ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" + # Default set of GCC warnings to enable. GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" +GCC_WARN_CFLAGS_FOR_BUILD="-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 @@ -11554,6 +11559,36 @@ fi rm -f conftest* +# Verify CC_FOR_BUILD to be compatible with waring flags + +# Add -Wshadow 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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-3]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" +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_for_build conftest.$ac_ext") 2>&5 | + $EGREP "^[0-4]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -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 @@ -11569,6 +11604,7 @@ case "${host}" in *-*-mingw32*) if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" fi ;; *) ;; @@ -11582,25 +11618,32 @@ fi NO_WERROR= if test "${ERROR_ON_WARNING}" = yes ; then GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" + GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" NO_WERROR="-Wno-error" fi if test "${GCC}" = yes ; then WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" fi # Check whether --enable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then : enableval=$enable_build_warnings; case "${enableval}" in - yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; no) if test "${GCC}" = yes ; then WARN_CFLAGS="-w" + WARN_CFLAGS_FOR_BUILD="-w" fi;; ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" + WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" + WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; + *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac fi @@ -11613,6 +11656,7 @@ fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -- 2.30.2