SYSROOT=/home/zhong/cross
PREFIX=$SYSROOT/usr
BINUTILS=binutils-2.20
GCC=gcc-4.4.2
GLIBC=glibc-2.10.1
My steps:
1. Install linux headers to $SYSROOT/usr/include
2. ../$BINUTILS/configure --prefix=$PREFIX --target=arm-linux --with-
sysroot
3. bootstrap gcc
../$GCC/configure --prefix=$PREFIX --target=arm-linux --with-
sysroot=$SYSROOT --without-headers --with-newlib --disable-threads --
enable-languages=c
4. Compile glibc with bootstrap gcc
5. cross gcc
../$GCC/configure --prefix=$PREFIX --target=arm-linux --with-sysroot=
$SYSROOT --enable-languages=c,c++
make
The first 4 step work, but the last one.
Here is the last error:
/home/zhong/cross/usr/arm-linux/bin/ld: cannot find /home/zhong/cross/
usr/lib/libc.so.6 inside /home/zhong/cross
collect2: ld return 1
make[1]: *** [libgcc_s.so] Error 1
The libc.so.6 does exist in /home/zhong/cross/usr/lib
I don't understand why gcc searchs "/home/zhong/cross/usr/lib" rather
than "/usr/lib" in its sysroot.
Could somebody help me?
Thanks
Possibly because you to told it that SYSROOT is "/home/zhong/cross" ?