http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25672
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jsm28 at gcc dot gnu.org --- Comment #33 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-15 15:02:54 UTC --- Re-confirmed on the 4.7 branch. configury now has # During gcc bootstrap, if we use some random cc for stage1 then CFLAGS # might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS # might also be empty (or "-g", if a non-GCC C++ compiler is in the path). # We want to ensure that TARGET libraries (which we know are built with # gcc) are built with "-O2 -g", so include those options when setting # CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. if test "x$CFLAGS_FOR_TARGET" = x; then CFLAGS_FOR_TARGET=$CFLAGS case " $CFLAGS " in *" -O2 "*) ;; *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;; esac case " $CFLAGS " in *" -g "* | *" -g3 "*) ;; *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;; esac fi AC_SUBST(CFLAGS_FOR_TARGET) ... (likewise CXXFLAGS_FOR_TARGET) but substituting CFLAGS here is certainly wrong. The above seems to be overeagerly trying to honor CFLAGS more broadly as a convenience. But doing so when build != target looks wrong. As alternative it should be documented that CFLAGS also applies to target libraries unless CFLAGS_FOR_TARGET is set.