Compiling with non primary libc
I am working in the embedded environment.I have a Cross compiler for arm architecture with eglibc as it's primary library (ie the default libc coming along with the tool chain).Now i want some of the applications to link with uClibc.So i compiled uClibc with that tool-chain.While trying to compile and link the application with uClibc,the error comes.It is getting linked with the default library of the tool-chain.I am more inclined that it is possible to have two different libc(eg eglibc, uClibc on the same machine.Am i right?
I searched on the net and came with the following
As it suggested, i did the following
$arm-unknown-linux-gnueabi-gcc -c test.c -o TEST
$arm-linux-gnueabi-gcc TEST -o dynamic_test_with_new_opts -Wl,-rpath=/home/user/UCLIBC/uClibc-0.9.32.1/INSTALL-DIR/usr/arm-linux-uclibc/lib -Wl,-dynamic-linker=/home/user/UCLIBC/uClibc-0.9.32.1/INSTALL-DIR/usr/arm-linux-uclibc/lib/ld-uClibc.so.0
In this case, it is getting linked with the default libc.so.6 of Eglibc
As the above link suggested,i tried out the following:
$arm-unknown-linux-gnueabi-gcc -Xlinker -rpath=/home/user/UCLIBC/uClibc-0.9.32.1/INSTALL-DIR/usr/arm-linux-uclibc/lib -Xlinker -I/home/user/UCLIBC/uClibc-0.9.32.1/INSTALL-DIR/usr/arm-linux-uclibc/lib/ld-uClibc-0.9.32.1.so test.c -o dynamic_test_with_linker_options
In this case, also,it is getting linked with the default libc.so.6 of Eglibc
I am confused with this,Am i making any mistake.Really i am stuck with this.please throw some light on this.
thanks and regards
I think -isystem flag may help you.
Your linker ld-* depends on eglibc. "arm-linux-gnueabi-gcc" too.
I don't see how you can trick those to use a different *libc.
The recommended one ( And the only one that is closely maintained )
is crosstool-ng http://crosstool-ng.org/
08 Feb 2012 : Released 1.14.1 :
|All times are GMT -5. The time now is 01:33 PM.|