[Clfs-dev] HELP ME: issue about arm cross toolchain (cannot find gmp.so, mpfr.so...)

Andrew Bradford andrew at bradfordembedded.com
Thu May 24 04:47:04 PDT 2012


On Thu, 24 May 2012 00:49:46 -0500
DJ Lucas <dj at linuxfromscratch.org> wrote:

> 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:

I'd agree with you, except (especially) on a multi-arch system (or
anything with cross compilers and cross libs), the shared libs for the
target arch are going to be in rather different places than the shared
libs for the host arch. I'm not sure LD_LIBRARY_PATH will do much for
you here.

On my Debian system, I have arm cross compilers from Emdebian and native
x86_64 compiler from Debian Squeeze, and I don't have LD_LIBRARY_PATH
even set (echo $LD_LIBRARY_PATH comes back empty).  I have no problem
cross compiling or native compiling.

For example, output from my armel GCC shows where it expects includes
and libs:

andrew at bradford:~/calc/linux$ arm-linux-gnueabi-gcc -v
Target: arm-linux-gnueabi
Configured with: <snip>
--libdir=/usr/lib --includedir=/usr/arm-linux-gnueabi/include
--build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=arm-linux-gnueabi --with-headers=/usr/arm-linux-gnueabi/include
--with-libs=/usr/arm-linux-gnueabi/lib

Generally, my understanding is, for sane make systems, setting
CROSS_COMPILE= or similar will get make to use the right GCC.  Then GCC
relies upon it's internal configuration in order to find the
includes and libraries.  I'm not sure how LD_LIBRARY_PATH plays with
cross compilers... Probably some interesting reading could nail this
down, though.  Now I want to find out...

-Andrew



More information about the Clfs-dev mailing list