LD_LIBRARY_PATH issue

Thomas De Schampheleire patrickdepinguin+uclibc at gmail.com
Fri Nov 4 09:10:10 UTC 2011


Hello,

Please don't top-post. See
http://linux.sgms-centre.com/misc/netiquette.php#toppost

On Fri, Nov 4, 2011 at 9:34 AM, Mahanteshwari Hiremath
<Mahanteshwari.Hiremath at lnties.com> wrote:
[..]
>>> I see it is over riding my native toll commands.
>>> suggest me how can i safely set this LD_LIBRARY_PATH, so that i can use native libraries and commands as well.
>>
>> Could you try to explain what you are doing in a bit more detail?
>> Are you building for the same machine on which you build, or are you
>> building for another target?
>>
>> Normally, you shouldn't need LD_LIBRARY_PATH at all. What happens if
>> you just run your application?
>>
>> You may want to use chroot to create a temporary environment in which
>> the 'buildroot/output/target' directory is at /, so that only those
>> libraries can be found, see http://linux.die.net/man/1/chroot.
>> For example:
>> chroot /path/to/buildroot/output/target /bin/sh
>>
>
>                I am building for another target(i have a x86 based board).
> Yes as you suggested i have done chroot,
>
> <shell>chroot /path/to/buildroot/output/target /bin/sh
>
> and able to use the new root file system of build root. but now the question is my toolchain binaries like i586-linux-gcc,g++ all are present in /path/to/buildroot/output/staging/usr/bin and the libraries are in sysroot/lib and sysroot/usr/lib.
>
>
> how can I use them in this new temporary environment?
> I tried copying them manually to /bin and /lib of target and tried chroot and compiled ,but did not succeed.
>

Which version of Buildroot are you using?
Did you select the appropriate Development Tools in the target package
selection? In that case you should not need to copy things over, they
should be present in target anyway.

I may have misguided you for the chroot: instead of starting the
chroot directly in output/target, you should unpack the rootfs to a
temporary location, and use that as chroot. The reason is that /dev
files are not correct in output/target. This is the same when using
NFS, as described on slide 36 of
http://elinux.org/images/2/2a/Using-buildroot-real-project.pdf.

Note that this topic is now becoming buildroot rather than uclibc
specific. You may want to redirect this question to the buildroot
mailing list instead.

Best regards,
Thomas


More information about the uClibc mailing list