[Clfs-dev] HELP ME: issue about arm cross toolchain (cannot find gmp.so, mpfr.so...)
DJ Lucas
dj at linuxfromscratch.org
Wed May 23 22:49:46 PDT 2012
On 05/24/2012 12:03 AM, lee sudo wrote:
>
> Do you know the root cause?
> And how to?
Unfortunately, I am not well versed in cross compilers (always relied on
the CodeSorcery scripts for arm), so this response could possibly be a
wild goose chase (but I think it's correct). I suspect you are looking
for LD_LIBRARY_PATH...at least that's what works on native compilers,
though I suspect the same with cross compilers since it runs native,
just the output is for different arch. If my guess is right, you'll want
something like the following in your working environment:
LD_LIBRARY_PATH="/home/sudolee/cross_toolchain/lib"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/home/sudolee/your/final/project/output/dir/rootfs/lib"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/home/sudolee/your/final/project/output/dir/rootfs/usr/lib"
export LD_LIBRARY_PATH
Add any additional library paths in your project anddrop that into a
shell script in your home dir. Execute it any time you intend to compile
for your project. If that turns out not to work, there should be
something similar for cross compilers I would think. The default runtime
search paths are different and are arch dependent. You'll probably want
to modify those in the source before you build your cross toolchain, but
LIBRARY_PATH and LD_PRELOAD _might_ make a crutch on the target if you
didn't do that at the beginning. Those same two variables are also
useful on the host if your toolchain is linked to a specific set of
libraries that does not include the default library search path
(/usr/lib64:/usr/lib:/lib64:/lib). Also beware of linker scripts that
might crop up (usually .so files with hard-coded paths) or .la files
(also with hard-coded paths).
HTH
-- DJ Lucas
--
This message has been scanned for viruses and
dangerous content, and is believed to be clean.
More information about the Clfs-dev
mailing list