[Buildroot] external buildroot toolchain: LD_LIBRARY_PATH needed

Thomas De Schampheleire patrickdepinguin+buildroot at gmail.com
Wed Sep 7 10:37:06 UTC 2011


Hi Thomas,

On Tue, Sep 6, 2011 at 5:24 PM, Thomas Petazzoni
<thomas.petazzoni at free-electrons.com> wrote:
> Hello,
>
> Le Thu, 25 Aug 2011 11:07:31 +0200,
> Thomas De Schampheleire <patrickdepinguin+buildroot at gmail.com> a écrit :
>
>> However, the missing library does not seem part of sysroot. It is
>> located at output/host/opt/ext-toolchain/lib
>> where libgmp, libmpfr, libexpat etc. reside.
>
> Those libraries are libraries for the host, and they are used by gcc
> and binutils.
>
>> Maybe this wrapper should be adapted as to include the proper
>> LD_LIBRARY_PATH?
>
> No, I don't think it's the right solution. I think there are two
> solutions:
>
>  * Link the toolchain binaries statically against those libraries so
>   that the toolchain binaries only rely on the C libraries but not on
>   gmp, mpfr, etc.
>
>  * Link the toolchain binaries with a proper rpath.

When using the rpath solution, we should of course make sure that
these paths are relative to the executable (as it may move). According
to the following link, $ORIGIN can be used for that purpose:
http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/1b713af28905247b?pli=1

I couldn't say which one is better.

How will we handle this? I'm willing to test any possible solution,
but to be honest I have little experience with creating toolchains so
I doubt that I can provide patches for this.

>
>> How does crosstool-ng handle this fixed-path problem?
>
> From what I can see, using static linking against those libraries.
>

Thanks,
Thomas


More information about the buildroot mailing list