I am trying to build a cross compiling gcc for ARM. This will be to update an existing gcc ARM cross compiler. The build runs fine until it gets to building libstdc++, after libgcc1 builds successfully.
The error is:
<gcc-object-path>/./gcc/xgcc -shared-libgcc -B<gcc-object-path>/./gcc -nostdinc++ -L<gcc-object-path>/<target>/libstdc++-v3/src -L<gcc-object-path>/<target>/libstdc++-v3/src/.libs -L<gcc-object-path>/<target>/libstdc++-v3/libsupc++/.libs -B<sysroot>/<target>/bin/ -B<sysroot>/<target>/lib/ -isystem <sysroot>/<target>/include -isystem <sysroot>/<target>/sys-include --sysroot=<boot-strap-xgcc-sysroot> -x c++-header -nostdinc++ -g -Os -I<gcc-object-path>/<target>/libstdc++-v3/include/<target> -I<gcc-object-path>/<target>/libstdc++-v3/include -I<gcc-source-path>/libstdc++-v3/libsupc++ -O2 -g -std=gnu++0x <gcc-source-path>/libstdc++-v3/include/precompiled/stdc++.h \
-o <target>/bits/stdc++.h.gch/O2ggnu++0x.gch
<gcc-source-path>/libstdc++-v3/include/precompiled/stdc++.h:52:20: fatal error: ccomplex: No such file or directory
#include <ccomplex>
^
compilation terminated.
find gcc-object-path -name ccomplex -print shows:
<gcc-object-path>/<target>/libstdc++-v3/include/tr1/ccomplex
<gcc-object-path>/<target>/libstdc++-v3/include/ccomplex
The compile command has
-I<gcc-object-path>/<target>/libstdc++-v3/include
on it.
<gcc-object-path>/<target>/libstdc++-v3/include/ccommon
is a symbolic link to
<gcc-source-path>/libstdc++-v3/include/c_std/ccomplex
But that file does not exist in the source at that location, so it is a broken symlink and the compile fails. The file ccomplex does exist in the source tree in three other locations, though. There are 6 other such symlinks that are also similarly broken.
Looking at the libstdc++-v3/include/Makefile that generates these symlinks, it expects to find all of the c_base_headers files in the same location in the source tree, but they are not. How is this supposed to work?
The gcc configure options are:
gcc-${GCC_VERSION}/configure --target=$CONF_TARGET --prefix=${PREFIX} --exec_prefix=${PREFIX} --bindir=${PREFIX}/bin --sbindir=${PREFIX}/bin --libexecdir=${PREFIX}/libexec --datadir=${PREFIX}/share --sysconfdir=${PREFIX}/etc --sharedstatedir=${PREFIX}/share/com --localstatedir=${PREFIX}/var --libdir=${PREFIX}/lib --includedir=${PREFIX}/include --oldincludedir=${PREFIX}/include --infodir=${PREFIX}/share/info --mandir=${PREFIX}/share/man --enable-largefile --disable-nls --enable-ipv6 --with-gnu-ld --enable-shared --enable-languages=c,c++,objc,fortran --enable-threads=posix --disable-multilib --enable-c99 --enable-long-long --enable-symvers-gnu --enable-libstdcxx-pch --program-prefix=${CMD_PREFIX} --enable-target-optspace --enable-cheaders=c_std --disable-bootstrap --disable-libgomp --disable-libmudflap --with-float=soft --with-sysroot=${NEWSYSROOT} --with-build-sysroot=${SYSROOT} --with-build-time-tools=${INSTALLDIR}/${PREFIX}/${CONF_TARGET}/bin --disable-libunwind-exceptions --disable-libssp --enable-__cxa_atexit
./configure
arguments are you using?--enable-libstdcxx-pch
is the option causing problems here; could you try without that?