http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57282

            Bug ID: 57282
           Summary: Canadian cross on FreeBSD to MingW32 fails with
                    unknown warning "-Wno-narrowing" is build gcc is too
                    old
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chris at contemporary dot net.au

Using gcc-4.8-branch sources from the git repo.

FreeBSD 9.1 machine with the default gcc-4.2.1.

Build the ports for devel/mingw32-binutils, devel/mingw32-gcc and
devel/mingw32-zlib. This gives a mingw32-gcc that is gcc-4.7.2.

Follow the standard build process for a canadian cross to arm-rtems4.11 you end
up with:

../gcc-4.8.0/configure --prefix=/opt/rtems/4.11 --bindir=/opt/rtems/4.11/bin
--exec_prefix=/opt/rtems/4.11 --includedir=/opt/rtems/4.11/include
--libdir=/opt/rtems/4.11/lib --libexecdir=/opt/rtems/4.11/libexec
--mandir=/opt/rtems/4.11/share/man --infodir=/opt/rtems/4.11/share/info
--datadir=/opt/rtems/4.11/share --build=x86_64-freebsd9.0 --host=mingw32
--target=arm-rtems4.11 --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld
--verbose --with-newlib --with-system-zlib --disable-nls
--without-included-gettext --disable-win32-registry
--enable-version-specific-runtime-libs --disable-lto
--enable-newlib-io-c99-formats --enable-newlib-iconv --enable-threads
--disable-plugin --enable-obsolete --enable-languages=c,c++

This fails at:

/usr/bin/g++ -O2 -pipe
-I/usr/home/chrisj/development/rtems/src/rtems-source-builder/rtems/build/tmp/sb-chrisj/4.11/rtems-arm.bset/opt/rtems/4.11/include
-L/usr/home/chrisj/development/rtems/src/rtems-source-builder/rtems/build/tmp/sb-chrisj/4.11/rtems-
arm.bset/opt/rtems/4.11/lib -I/usr/local/include -L/usr/local/lib -c   -g -O2
-DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -pe
dantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings  
-DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gcc-4.8.0/gcc
-I../../gcc-4.8.0/gcc/build -I../../gcc-4.8.0/gcc/../include
-I../../gcc-4.8.0/gcc/../libcpp/include -I/usr/home/chri
sj/development/rtems/src/rtems-source-builder/rtems/build/arm-rtems4.11-gcc-4.8.0-newlib-13-May-2013-1/arm-rtems4.11-gcc-4.8.0-newlib-13-May-2013-1-4.8.0/build-cxc/./gmp
-I/usr/home/chrisj/development/rtems/src/rtems-source-builder/rtems/build/arm-rtems
4.11-gcc-4.8.0-newlib-13-May-2013-1/arm-rtems4.11-gcc-4.8.0-newlib-13-May-2013-1-4.8.0/gcc-4.8.0/gmp
-I/usr/home/chrisj/development/rtems/src/rtems-source-builder/rtems/build/arm-rtems4.11-gcc-4.8.0-newlib-13-May-2013-1/arm-rtems4.11-gcc-4.8.0-newlib-13
-May-2013-1-4.8.0/build-cxc/./mpfr
-I/usr/home/chrisj/development/rtems/src/rtems-source-builder/rtems/build/arm-rtems4.11-gcc-4.8.0-newlib-13-May-2013-1/arm-rtems4.11-gcc-4.8.0-newlib-13-May-2013-1-4.8.0/gcc-4.8.0/mpfr
-I/usr/home/chrisj/development/rt
ems/src/rtems-source-builder/rtems/build/arm-rtems4.11-gcc-4.8.0-newlib-13-May-2013-1/arm-rtems4.11-gcc-4.8.0-newlib-13-May-2013-1-4.8.0/gcc-4.8.0/mpc/src
 -I../../gcc-4.8.0/gcc/../libdecnumber
-I../../gcc-4.8.0/gcc/../libdecnumber/dpd -I../libdecnumber
 -I../../gcc-4.8.0/gcc/../libbacktrace    \
-DBASEVER="\"4.8.1\"" -DDATESTAMP="\" 20130515\"" \
-DREVISION="\"\"" \
-DDEVPHASE="\" (RTEMS
4.11-RSB(1b40c77e7b9ed7d87ec555abe0a0f4691841a2f8)-1,gcc-4.8.0/newlib-13-May-2013)\""
-DPKGVERSION="\"(GCC) \"" \
-DBUGURL="\"<http://gcc.gnu.org/bugs.html>\"" -o build/version.o
../../gcc-4.8.0/gcc/version.c
cc1plus: error: unrecognized command line option "-Wno-narrowing"

because the warnings test to select the warnings uses the mingw32 (host)
compiler rather than the build compiler. If I build and install a FreeBSD
gcc-4.7.2 compiler the error does not happen.

Also the warnings test is for the C compiler and not the C++ compiler, ie they
must be the same version which is fair enough but not tested for when configure
runs. I had configuration issues having the different versions on the machine
because of above this can be confusing.

If all the versions are correct things build however this error and reason are
not straight forward.

Reply via email to