[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't cross-compile with same libdir as the host one

From: Ralf Wildenhues
Subject: Re: Can't cross-compile with same libdir as the host one
Date: Mon, 1 Nov 2010 21:30:49 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

Hi Loïc,

thanks for the bug report.

* Loïc Minier wrote on Sat, Oct 23, 2010 at 04:31:19PM CEST:
>  As part of a project to cross-build Debian packages, I've been looking
>  into an issue which affects libtool packages.  I can actually reproduce
>  the issue very easily with the libtool 2.2.6b release tarball (current
>  version in Debian/Ubuntu) and with the 2.4 tarball:
> cd libtool/tests/depdemo
> ./configure --build=x86_64-linux-gnu --host=arm-linux-gnueabi 
> --libdir=/usr/lib
> make install DESTDIR=`pwd`/destdir

>  /bin/bash ../libtool   --mode=install /usr/bin/install -c   libl2.la 
> '/home/lool/scratch/libtool/upstream/libtool-2.2.6b/tests/depdemo/destdir/usr/lib'
> libtool: install: warning: relinking `libl2.la'
> libtool: install: (cd 
> /home/lool/scratch/libtool/upstream/libtool-2.2.6b/tests/depdemo/l2; 
> /bin/bash 
> /home/lool/scratch/libtool/upstream/libtool-2.2.6b/tests/depdemo/libtool  
> --tag CC --mode=relink arm-linux-gnueabi-gcc -g -O2 -no-undefined -o libl2.la 
> -rpath /usr/lib l2.lo ../l1/libl1.la -inst-prefix-dir 
> /home/lool/scratch/libtool/upstream/libtool-2.2.6b/tests/depdemo/destdir)
> libtool: relink: arm-linux-gnueabi-gcc -shared  .libs/l2.o   
> -L/home/lool/scratch/libtool/upstream/libtool-2.2.6b/tests/depdemo/destdir/usr/lib
>  -L/usr/lib -ll1    -Wl,-soname -Wl,libl2.so.0 -o .libs/libl2.so.0.0.0
> /usr/lib/gcc/arm-linux-gnueabi/4.4.5/../../../../arm-linux-gnueabi/bin/ld: 
> skipping incompatible /usr/lib/libc.so when searching for -lc
> /usr/lib/libc.a: could not read symbols: File format not recognized

>  Now, it would be possible to workaround this by configuring binutils to
>  support the host as a bfd target, and ld would just skip this x86-64
>  library, but I think it's a bad idea as it would probably break subtly
>  in x86 -> x86 cross-builds.

I agree, on all accounts.

>  It is entirely possible that this is a toolchain bug, but I think
>  libtool has this design to use -rpath to specify the installation
>  directory, which might be why the linker looks in this directory.

Can you work around it by using the Libtool 2.4 --with-sysroot feature?
Please report back if that doesn't help.

>  Is this a libtool bug?  I wonder whether libtool should pass
>  -rpath-link instead.

That might indeed be necessary; haven't checked in detail yet.

>  If you'd like to reproduce this, I'm using the armel cross toolchain
>  from the development Ubuntu version ("natty"), but the same problem is
>  probably visible in Ubuntu 10.10 ("maverick").  This toolchain is
>  provided by the binutils-arm-linux-gnueabi and gcc-arm-linux-gnueabi
>  packages.

Thanks, also for providing a concise and detailed report, and sorry for
being totally out of time to look into it more ATM,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]