Trouble with --with-sysroot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm trying to learn how to build gcc cross-compilers "by hand" by using the
documentation from Linux From Scratch and crosstool-NG.

I have successfully reached the last step of creating a cross-compiler that
should build executables but $TARGET-gcc reports that $TARGET-ld fails with
a message of the form:

.../$TARGET-ld cannot find /home/alex/sysroot/usr/lib/libc.so.6 inside
/home/alex/sysroot

With similar lines for libc_nonshared.a and ld64.so.2 following,
respectively. I have tested with several targets with the same error. Glibc
is correctly installed in the sysroot under usr.

This error can be recreated from native ld by passing in -L/usr/lib
--sysroot=/ as additional arguments (obtained by gcc -###) to the ones
passed in by gcc.

Looking at the output from $TARGET-gcc -### test.c I can see that it is
passing -L/home/alex/sysroot/usr/lib and --sysroot=/home/alex/sysroot as
arguments.

Am I using --with-sysroot for binutils and gcc correctly?

Configure for binutils 2.32:
$HOME/src/binutils-gdb/configure --build=x86_64-unkown-linux-gnu
--host=x86_64-unkown-linux-gnu --target=$TARGET --disable-nls
--disable-multilib --prefix=$HOME/cross --with-sysroot

Configure for final build of gcc 9.1.0:
$HOME/src/gcc/configure --build=x86_64-unkown-linux-gnu
--host=x86_64-unkown-linux-gnu --target=$TARGET --disable-nls
--disable-multilib --disable-werror --disable-threads
--disable-decimal-float --disable-libstdcxx --disable-libssp
--disable-libquadmath --disable-libatomic --disable-libgomp
--disable-libmpx --disable-libvtv --disable-libobjc --prefix=$HOME/cross
--enable-languages=c,c++ --with-sysroot=$HOME/sysroot

As far as I know, nothing that I have disabled is necessary for a simple C
program.

Thanks.

~ Alex



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux