problem building gcc-4.7.0

2012-04-14
2013-06-06
  • ralph engels
    ralph engels
    2012-04-14

    Hello. Im facing a rather weird problem bootstrapping gcc-4.7.0.
    My build environment works for bootstrapping all versions of gcc up untill 4.6.3 but 4.7.0 fails to build because it cannot find system headers (complains about missing stdarg.h stddef.h etc.) going through the log i notice that stage2 is not including any system headers at all, only headers local to the source. also it fails to build unless you make a symlink to cpp.exe in /usr/lib (sanity error). building without bootstrapping also fails so thats not an option it seems, but ray linn has built it so i was wondering if he could share some insight ?.

    revelator

     
  • Jonathan Yong
    Jonathan Yong
    2012-04-14

    Show your configure options for gcc, binutils, mingw-w64-headers and mingw-w64-crt.

     
  • ralph engels
    ralph engels
    2012-04-14

    gcc build flags

    ../src/gcc-4.6.3/configure \
    -build=i686-w64-mingw32 \
    -enable-threads=win32 \
    -enable-languages=c,ada,c++,lto,fortran,objc,obj-c++ \
    -enable-graphite \
    -enable-targets=i686-w64-mingw32 \
    -enable-lto  \
    -enable-libgomp \
    -enable-checking=release \
    -enable-version-specific-runtime-libs \
    -enable-cxx-flags='-fomit-frame-pointer -fno-function-sections -fno-data-sections' \
    -enable-libstdcxx-time=yes \
    -enable-interwork \
    -disable-libstdcxx-pch \
    -disable-nls \
    -disable-multilib \
    -disable-debug \
    -disable-symvers \
    -disable-werror \
    -disable-64bit \
    -disable-win32-registry \
    -enable-plugin \
    -enable-fully-dynamic-string \
    -prefix=/mingw32 \
    -with-sysroot=/mingw32 \
    -with-build-sysroot=/mingw32 \
    -with-libiconv-prefix=/mingw32 \
    -without-dwarf2 \
    -without-newlib \
    -with-gmp=/mingw32 \
    -with-mpc=/mingw32 \
    -with-mpfr=/mingw32 \
    -with-gcc \
    -with-gnu-as \
    -with-gnu-ld \
    -with-stabs \
    gcc_cv_prog_makeinfo_modern=yes \
    MAKEINFO="/usr/bin/makeinfo" && make

    the above for the x86 compiler.

    binutils

    echo "int _dowildcard = -1;" >$PWD/glob_enable.c && \
    gcc -c -o $PWD/glob_enable.o $PWD/glob_enable.c && \
    ../src/binutils/configure \
    -build=i686-pc-mingw32 \
    -enable-targets=i686-pc-mingw32 -enable-checking=release -enable-lto -enable-plugin \
    -disable-werror -prefix=/mingw32 \
    -with-lib-path="/mingw32/lib:/mingw32/i686-pc-mingw32/lib" \
    -with-sysroot=/mingw32 -disable-nls -disable-multilib \
    CFLAGS="-I/mingw32/include -s" \
    CXXFLAGS="-I/mingw32/include -s -mthreads" \
    LDFLAGS="-L/mingw32/lib -s -Wl,$PWD/glob_enable.o" && make

    and mingw-w64 api

    ../configure \
    -build=i686-w64-mingw32 \
    -enable-sdk=all \
    -enable-idl \
    -enable-tests-unicode \
    -with-libraries=all \
    -with-tools=all \
    -enable-secure-api \
    -enable-wildcard \
    -enable-lib32 \
    -disable-lib64 \
    -prefix=/mingw32 \
    -with-sysroot=/mingw32 \
    -disable-multilib && make

     
  • Jonathan Yong
    Jonathan Yong
    2012-04-15

    Did you link your CRT/headers i686-w64-mingw32 to mingw?

    You should have mingw32/mingw.

     
  • ralph engels
    ralph engels
    2012-04-15

    aye the sysroot is there /mingw32/mingw/include /mingw32/mingw/lib etc. i linked the content of i686-w64-mingw32 to /mingw32/mingw.
    its a bit weird as it works with all previous versions of gcc, but 4.7.0 just cannot find headers.
    i stumbled about a bug report on the gcc site where someone else had the same problem but there was no fix yet.

    btw ignore the i686-pc-mingw32 in my binutils flags its from an older build.sh i dont use anymore i changed it to i686-w64-mingw32 but else the options are the same.

    i can build it if i copy all headers/libraries to the builddir/gcc folder in the final boostrap but that should not be nessesary.

     
  • ralph engels
    ralph engels
    2012-04-17

    Ok bootstrap still a nogo but i managed to build it, there are a few problems though.
    Anything relying on libstdc++ will crash with error 0x000005 (maybe sources needs to be fixed for the new keyword in c++11 ?).
    Lto is broken… building anything with lto will segfault the lto wrapper.

     
  • ralph engels
    ralph engels
    2012-05-11

    Ok libstdc++ is atleast one of the problems it seems. i can build things with it just fine but they all crash. Confirmed by replacing the libstdc++ dll with a previous version (works again then but not applicapable for a static build though).
    Seems a bug snuck in with the new version ?.

    Bootstrap still a nogo header path composition seems to go wrong in stage2 when looking for system headers with #include_next <someheader> odd thing is that it tries to use the stage1 includes ???

    Btw the error was 0xc00000005 from libstdc++. (might be a zero to much im writing of my head here heh).
    Tried building from trunk but the bootstrap bug is not fixed yet as far as i can see.