On 2/1/2011 11:55 PM, Torsten Mohr wrote:
> Hello,
> 
> thanks a lot for your hint.
> 

Hi,

>  > > I'll give it a try on my ARM target but it sounds to me very strange.
>  > >
>  > > carmelo
>  >
>  > Hi,
>  > I think that your toolchain is not properly configured, so it is not
>  > using the dynamic linker from the uClibc (where these symbols are
>  > defined)... I guess it is still using ld-linux.so.2.
>  >
>  > Check your toolchain configuration, especially the value of --target.
>  >
>  > Carmelo
> 
> Here are the commands i used to configure the used toolchains:
> 
> ARCH=arm
> TARG=arm-linux-elf
> CROSS_COMPILE=$TARG-
> SYSROOT=`pwd`/sysroot
> PREFIX=/opt/$TARG
> 
> export PATH=$PREFIX/bin:$PATH
> 
> for binutils i did:
> 
> ../binutils-2.21/configure \
> --target=$TARG \
> --prefix=$PREFIX \
> --disable-nls \
> --enable-shared
> make
> make install
> 
> for gcc i did:
> 
> ../gcc-4.5.2/configure \
> --target=$TARG \
> --prefix=$PREFIX \
> --enable-languages="c" \
> --disable-nls \
> --disable-libssp \
> --enable-shared
> make
> make install
> 
> for kernel-headers i did:
> make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE \
> INSTALL_HDR_PATH=/opt/arm-linux-elf headers_install
> 
> 
> So --targ is arm-linux-elf in all cases, which looks ok to me.
> 

I think this is not correct. It should be arm-linux-uclibc-elf or
similar... for sure you must have the uclibc keyword in the target.
In the newer gcc the presence of uclibc keyword is used to detect that
the toolchain is intended for uClibc, and it will automatically use the
proper ld.so (/lib/ld-uClibc.so.0).

If you try to compile something with your toolchain, using -v, I'm
pretty sure you will see --dynamic-linker=/lib/ld-linux.so.2. This will
demonstrate that it is wrongly configured.

Use --target consistently for binutils also.

My toolchain (for CA9) use --target=arm-cortex-linux-uclibcgnueabi
> 
> I'm not sure, but i think i'm missing something. I configured and installed
> binutils, gcc and the kernel headers as described above.
> 
> Then i configured uClibc and then typed::
> make CROSS=$CROSS_COMPILE
> KERNEL_HEADERS=/local/armbuild/sysroot/usr/include/include V=2
> 
> 

this is ok

> It seems i need to tell the tools to use a different lib to link against?
> 

yes, and this is due to a wrong configuration as I think.

> One thing i'm not sure about, you write that you think i'm not using the
> correct linker, do you mean "not using the correct lib" instead?
> 
> Trying to track the problem further down i did some more tests.
> 
> As an example, searching for _dl_app_fini_array:
> 
> tmohr@schleim:/local/armbuild/uClibc-0.9.31> grep -r _dl_app_fini_array *
> ldso/ldso/dl-array.c:void _dl_app_fini_array(void);
> ldso/ldso/dl-array.c:void _dl_app_fini_array(void)
> Übereinstimmungen in Binärdatei ldso/ldso/ldso.oS.
> Übereinstimmungen in Binärdatei ldso/ldso/ld-uClibc_so.a.
> Übereinstimmungen in Binärdatei libc/misc/internals/__uClibc_main.oS.
> libc/misc/internals/__uClibc_main.c:extern void _dl_app_fini_array(void);
> libc/misc/internals/__uClibc_main.c://extern void weak_function
> _dl_app_fini_array(void) attribute_hidden;
> libc/misc/internals/__uClibc_main.c: _dl_app_fini_array();
> Übereinstimmungen in Binärdatei libc/libc_so.a.
> 
> Then i was verifying the single occurrences in binary files:
> 
> /local/armbuild/uClibc-0.9.31> nm ldso/ldso/ldso.oS | grep _dl_app_fini_array
> 000001e4 T _dl_app_fini_array
> 
> /local/armbuild/uClibc-0.9.31> nm ldso/ldso/ld-uClibc_so.a | grep
> _dl_app_fini_array
> 000001e4 T _dl_app_fini_array
> 
> /local/armbuild/uClibc-0.9.31> nm libc/misc/internals/__uClibc_main.oS | grep
> _dl_app_fini_array
> U _dl_app_fini_array
> 
> /local/armbuild/uClibc-0.9.31> nm libc/libc_so.a | grep _dl_app_fini_array
> U _dl_app_fini_array
> 
> 

the symbols are ok.... you are just not using the proper ld.so
> 
> You mentioned "ld-linux.so.2" above, i searched in uClibc and in /opt/arm-
> linux-elf (where my toolchain is installed) for"ld-linux*", no occurrences.
> 
> 

try to compile something with -v as suggested

> I'm not sure where the problem is, to me there is no obvious problem in the
> toolchain configuration and i'm not sure about the used libs, also the
> compile&install process of uClibc looked ok to me.
> 
> But i'm absolutely not sure if i'm missing something, something must be wrong.
> 
> 
> Any hint is really appreciated.
> 
> 
> Best regards,
> Torsten.

Carmelo

> _______________________________________________
> uClibc mailing list
> [email protected]
> http://lists.busybox.net/mailman/listinfo/uclibc
> 
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to