http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51388
Bug #: 51388 Summary: Configure failure to detect unsupported warning options for non-bootstrap builds (including cross builds) Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap AssignedTo: unassig...@gcc.gnu.org ReportedBy: ste...@gcc.gnu.org GCC current trunk (r181908) fails to do a non-bootstrap build (i.e. --disable-bootstrap, or a cross-compiler build). The build compiler I used was GCC 4.3. ... make[2]: Entering directory `/home/stevenb/devel/build/zlib' true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=-g -O2" "CFLAGS_FOR_TARGET=-g -O2" "INSTALL=/usr/b in/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS =" "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-g -O2" "MAKE=make" "MAKEINFO=makeinfo --split-size=5000000 --split-size=5000000 " "PICFLAG=" "P ICFLAG_FOR_TARGET=" "SHELL=/bin/sh" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/usr/local" "infodir=/usr/local/share/inf o" "libdir=/usr/local/lib" "prefix=/usr/local" "tooldir=/usr/local/x86_64-unknown-linux-gnu" "AR=ar" "AS=as" "CC=gcc" "CXX=g++" "LD=ld" "LIB CFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do # make make[2]: Leaving directory `/home/stevenb/devel/build/zlib' make[2]: Entering directory `/home/stevenb/devel/build/libcpp' gcc -I../../trunk/libcpp -I. -I../../trunk/libcpp/../include -I../../trunk/libcpp/include -g -O2 -W -Wall -Wno-narrowing -Wwrite-strings - Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wc++-compat -pedantic -Wno-long-long -I../../tru nk/libcpp -I. -I../../trunk/libcpp/../include -I../../trunk/libcpp/include -c -o macro.o -MT macro.o -MMD -MP -MF .deps/macro.Tpo ../../tru nk/libcpp/macro.c ../../trunk/libcpp/macro.c:146: warning: â?~tokens_buff_remove_last_tokenâ?T declared inline after being called ../../trunk/libcpp/macro.c:146: warning: previous declaration of â?~tokens_buff_remove_last_tokenâ?T was here cc1: error: unrecognized command line option "-Wno-narrowing" make[2]: *** [macro.o] Error 1 make[2]: Target `all' not remade because of errors. make[2]: Leaving directory `/home/stevenb/devel/build/libcpp' make[1]: *** [all-libcpp] Error 2 make[2]: Entering directory `/home/stevenb/devel/build/libdecnumber' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/stevenb/devel/build/libdecnumber' make[1]: Target `all-host' not remade because of errors. make[1]: Target `all-target' not remade because of errors. make[1]: Leaving directory `/home/stevenb/devel/build' make: *** [all] Error 2 $ Note the cc1 error. Problem seems to be that ACX_PROG_CC_WARNING_OPTS checks for -Wno-narrowing in isolation, and that check passes, but the actual options passed to GCC do not: $ cat t.c #ifdef HAVE_ARG void foo (int t) { return; } #else void foo (void) { return; } #endif $ # This is how the build process calls GCC, note -W -Wall $ gcc -c -W -Wall -Wno-narrowing t.c -DHAVE_ARG t.c:2: warning: unused parameter â?~tâ?T cc1: error: unrecognized command line option "-Wno-narrowing" $ # This is how the configure check calls the compiler $ gcc -c -Wno-narrowing t.c -DHAVE_ARG $ $ # Even more confusing: Make foo a void function, and the warning $ # does not trigger anymore at all! $ gcc -c -W -Wall -Wno-narrowing t.c $ gcc -c -Wno-narrowing t.c $