@@ -452,6 +452,8 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
--disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
--disable-build-format-warnings
+STAGE3_CONFIGURE_FLAGS = --disable-build-warnings
+
# When using the slow stage1 compiler disable IL verification and forcefully
# enable it when using the stage2 compiler instead. As we later compare
# stage2 and stage3 we are merely avoid doing redundant work, plus we apply
@@ -482,9 +482,22 @@ AC_ARG_ENABLE(build-format-warnings,
[],[enable_build_format_warnings=yes])
AS_IF([test $enable_build_format_warnings = no],
[wf_opt=-Wno-format],[wf_opt=])
+
+# In stage 3, build without most warnings so bootstrap comparison against
+# stage 2 verifies that checks for warnings do not affect code generation
+AC_ARG_ENABLE(build-warnings,
+ AS_HELP_STRING([--disable-build-warnings],
+ [do not enable most warnings while building GCC]),
+ [],[enable_build_warnings=yes])
+
+AS_IF([test "$enable_build_warnings" = yes],
+ [warn_opt="-W -Wall -Wcast-qual"],
+ # list warnings known to affect code generation: PR bootstrap/86518
+ [warn_opt="-Wsign-compare"])
+
ACX_PROG_CXX_WARNING_OPTS(
- m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings ],
- [-Wcast-qual $wf_opt])), [loose_warn])
+ m4_quote(m4_do([$warn_opt $wf_opt -Wno-narrowing -Wwrite-strings])),
+ [loose_warn])
ACX_PROG_CC_WARNING_OPTS(
m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])),
[c_loose_warn])
@@ -529,6 +529,8 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
--disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
--disable-build-format-warnings
+STAGE3_CONFIGURE_FLAGS = --disable-build-warnings
+
# When using the slow stage1 compiler disable IL verification and forcefully
# enable it when using the stage2 compiler instead. As we later compare
# stage2 and stage3 we are merely avoid doing redundant work, plus we apply
@@ -898,6 +898,7 @@ with_gnu_as
with_as
enable_largefile
enable_build_format_warnings
+enable_build_warnings
enable_werror_always
enable_checking
enable_coverage
@@ -1604,6 +1605,8 @@ Optional Features:
--disable-largefile omit support for large files
--disable-build-format-warnings
suppress -Wformat while building GCC
+ --disable-build-warnings
+ do not enable most warnings while building GCC
--enable-werror-always enable -Werror despite compiler version
--enable-checking[=LIST]
enable expensive run-time checks. With LIST, enable
@@ -6666,6 +6669,24 @@ if test $enable_build_format_warnings = no; then :
else
wf_opt=
fi
+
+# In stage 3, build without most warnings so bootstrap comparison against
+# stage 2 verifies that checks for warnings do not affect code generation
+# Check whether --enable-build-warnings was given.
+if test "${enable_build_warnings+set}" = set; then :
+ enableval=$enable_build_warnings;
+else
+ enable_build_warnings=yes
+fi
+
+
+if test "$enable_build_warnings" = yes; then :
+ warn_opt="-W -Wall -Wcast-qual"
+else
+ # list warnings known to affect code generation: PR bootstrap/86518
+ warn_opt="-Wsign-compare"
+fi
+
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6674,7 +6695,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
loose_warn=
save_CXXFLAGS="$CXXFLAGS"
-for real_option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual $wf_opt; do
+for real_option in $warn_opt $wf_opt -Wno-narrowing -Wwrite-strings; do
# Do the check with the no- prefix removed since gcc silently
# accepts any -Wno-* option on purpose
case $real_option in
@@ -18460,7 +18481,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18463 "configure"
+#line 18484 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18566,7 +18587,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18569 "configure"
+#line 18590 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19731,20 +19752,20 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
prelink_cmds_CXX='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
old_archive_cmds_CXX='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
$RANLIB $oldlib'
archive_cmds_CXX='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
archive_expsym_cmds_CXX='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
;;
*) # Version 6 and above use weak symbols
archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'