How to build cross compiler g++ ?
Peter Skvarka
ps@softinengines.com
Wed Sep 26 14:36:00 GMT 2007
Hi,
I need to built toolchain with g++ 3.4.4 for arm9 target.
I found several tutorials, but it seems no of them describes how to build
functional g++, but only gcc.
Last I tried this one: http://www.schnozzle.org/~coldwell/toolchain/
Building and installing binutils - OK.
Building and installing Linux kernel headers - OK.
Building and installing Glibc headers - OK.
After successful building Glibc headers I use this adjusted configure
command for creating makefile (added c++ and --without-headers):
../../gcc-3.4.4/configure --prefix=${PREFIX} --target=${TARGET}
--enable-languages=c,c++ --with-sysroot=${SYSROOT} --without-headers 2>&1 |
tee configure.out
make 2>&1 | tee make.out
make install 2>&1 | tee -a make.out
GNU C library (nothing changed by me ) :
BUILD_CC=gcc CC=${CROSS_COMPILE}gcc AR=${CROSS_COMPILE}ar
RANLIB=${CROSS_COMPILE}ranlib AS=${CROSS_COMPILE}as LD=${CROSS_COMPILE}ld
../../glibc-2.3.5/configure --prefix=/usr --build=i386-redhat-linux
--host=arm-unknown-linux-gnu --target=arm-unknown-linux-gnu
--without-__thread --enable-add-ons=linuxthreads
--with-headers=${SYSROOT}/usr/include 2>&1 | tee configure.out
make 2>&1 | tee make.out
make install_root=${SYSROOT} install
Stage 2 GCC (added c++ in --enable-languages parameter) :
../../gcc-3.4.4/configure --prefix=${PREFIX} --target=${TARGET}
--enable-languages=c,c++ --with-headers --with-sysroot=${SYSROOT} 2>&1 | tee
configure.out
make 2>&1 | tee make.out
make install 2>&1 | tee -a make.out
this step is finished with this error:
....
checking for main in -lm... configure: error: Link tests are not allowed
after GCC_NO_EXECUTABLES.
make: *** [configure-target-libstdc++-v3] Error 1
When I look into ./gcc I am seeing here created g++, but after installing it
it is not runnable, because it has not libstdc++, also under all my src
directory with toolchain sources is not libstdc++, only some epty
directories with that name are here.
What am I doing wrong ?
It seems that libstdc++ for 3.4.4 is missing, or it should be built with GNU
C library ?
I dont understand it, help me.
Thanks,
Peter
More information about the Gcc-help
mailing list