Incompatibility of uClibc and glibc.

Carmelo Amoroso carmelo73 at gmail.com
Wed Sep 27 09:35:29 UTC 2006


Arvind Kumar wrote:
> Hi!
> I have made toolchain for  Power PC linux.
> But when I am executing the host cross compiled program on target. It is 
> not executing.
> Target has all the toochain build with uClibc.
You mean target uses uClibc (and not glibc)

> While I have toolchain on host  build with glibc.  
Do you mean you have a cross compiler configured with glibc?
Well, you need a cross compiler configured with uClibc, so your
cross-built program will look for the uClibc dynamic linker 
(ld-uClibc.so.0)  and the uClibc DSO (libc.so.0) correctly.

If you program has been built with a glibc-cross compiler, it will
search the glibc dynamic linker (ld-linux.so.2) and the glibc DSO 
(libc.so.6) at least.

Statically link program is working fine.
As expected
> I also created necessary links on target, but did not get anything useful.
> Is uClibc and libc are not compatible.

Well, they could co-exist on the same target, but installed on different 
path; you need to use the correct cross compiler and play with
--dynamic-linker gcc option. For sure you cannot mix libraries from the 
two toolchain.

Remember that the uClibc ld.so will search your dependencies DSO in the 
same path of the ld.so first... it is very usefull for your purpose...

Assuming that you have all glibc toolchain on /lib and all uClibc 
toolchain on /uClibc-lib onto your target, you may cross-compile your 
app for uClibc as follows:

<cross-uclibc-gcc> -Wl,--dynamic-linker,/lib/uClibc-lib/ld-uClibc.so.0 
-o <your_app_executable> <your_app_source>

It works fine for me.
Hoping to be usefull

Carmelo

> Any clue will be appricited.
> 
> With Best Regards,
> Arvind
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://busybox.net/cgi-bin/mailman/listinfo/uclibc




More information about the uClibc mailing list