Hello Drasko,

On Wednesday 14 November 2012 00:38:08 Drasko DRASKOVIC wrote:
> Hi all,
> Trying to cross compile libdespotify, I have run into problem with libtool :
> 
> libtool  --tag=CC --verbose --mode=link
> mipsel-openwrt-linux-uclibc-gcc -o libdespotify.la -rpath /usr/lib
> -rpath-link 
> /home/drasko/carambola/carambola/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib
> -L/home/drasko/carambola/carambola/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/lib
> -L/home/drasko/carambola/carambola/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib
> -lz -lvorbisfile -lcrypto -lresolv -lpthread aes.lo auth.lo buf.lo
> cache.lo channel.lo commands.lo dns.lo ezxml.lo handlers.lo
> keyexchange.lo packet.lo puzzle.lo session.lo shn.lo sndqueue.lo
> util.lo network.lo despotify.lo sha1.lo hmac.lo xml.lo
> OpenWrt-libtool: link: gcc -shared  -fPIC -DPIC  .libs/aes.o
> .libs/auth.o .libs/buf.o .libs/cache.o .libs/channel.o
> .libs/commands.o .libs/dns.o .libs/ezxml.o .libs/handlers.o
> .libs/keyexchange.o .libs/packet.o .libs/puzzle.o .libs/session.o
> .libs/shn.o .libs/sndqueue.o .libs/util.o .libs/network.o
> .libs/despotify.o .libs/sha1.o .libs/hmac.o .libs/xml.o
> -L/home/drasko/carambola/carambola/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/lib
> -L/home/drasko/carambola/carambola/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib
> -lz -lvorbisfile -lcrypto -lresolv -lpthread    -Wl,-soname
> -Wl,libdespotify.so.0 -o .libs/libdespotify.so.0.0.0
> /usr/bin/ld.bfd.real: .libs/aes.o: Relocations in generic ELF (EM: 8)
> /usr/bin/ld.bfd.real: .libs/aes.o: Relocations in generic ELF (EM: 8)
> /usr/bin/ld.bfd.real: .libs/aes.o: Relocations in generic ELF (EM: 8)
> /usr/bin/ld.bfd.real: .libs/aes.o: Relocations in generic ELF (EM: 8)
> /usr/bin/ld.bfd.real: .libs/aes.o: Relocations in generic ELF (EM: 8)
> /usr/bin/ld.bfd.real: .libs/aes.o: Relocations in generic ELF (EM: 8)
> .libs/aes.o: could not read symbols: File in wrong format
> collect2: ld returned 1 exit status
> make[3]: *** [libdespotify.la] Error 1
> 
> 
> Instead of cross-compiler, libtool calls native gcc in the link mode
> (in the compile mode everything OK, though).

I see several issues with this log excerpt:
- the first libtool link command uses /usr/lib as a host path (second line)
  this needs fixing
- the second libtool command does not use the cross-linker, and for that I
  have no idea yet

> 
> This problem is described here :
> http://www.metastatic.org/text/libtool.html
> 
> 
> I have two questions at this point :
> 1) I sew that OpenWRT buildsystem uses staging_dir/host/bin/libtool.
> If this (host) libtool is normally used for building packages and not
> cross compiled libtool, did I do something wrong in my Makefile?

The compiled libtool resides in host because it is actually compiled for the 
host system, there is no other libtool executable in the build system besides
those copies provided by other packages we build.

> 
> 2) If some other, cross-compiled libtool should be used, where can I
> find it? I do not see it in the toolchain directory. However, I can
> see many different libtools, si I was wondering why we need so many
> and how are they different :
> 
> drasko@Marx:~/carambola/carambola$ find . -name libtool
> ./tools/libtool
> ./build_dir/linux-ramips_rt305x/opkg-618/libtool
> ./build_dir/linux-ramips_rt305x/iptables-1.4.10/libtool
> ./build_dir/target-mipsel_r2_uClibc-0.9.33.2/libao-1.1.0/libtool
> ./build_dir/target-mipsel_r2_uClibc-0.9.33.2/libvorbis-1.2.3/libtool
> ./build_dir/target-mipsel_r2_uClibc-0.9.33.2/liblo-0.26/libtool
> ./build_dir/target-mipsel_r2_uClibc-0.9.33.2/alsa-lib-1.0.24.1/libtool
> ./build_dir/target-mipsel_r2_uClibc-0.9.33.2/libogg-1.1.4/libtool
> ./build_dir/target-mipsel_r2_uClibc-0.9.33.2/json-c-0.9/libtool
> ./build_dir/target-mipsel_r2_uClibc-0.9.33.2/udev-173/libtool
> ./build_dir/host/gmp-5.0.5/libtool
> ./build_dir/host/libtool-2.4/libtool
> ./build_dir/host/pkg-config-0.25/glib-1.2.10/libtool
> ./build_dir/host/pkg-config-0.25/libtool
> ./build_dir/host/opkg-618/libtool
> ./build_dir/host/mpc-0.9/libtool
> ./build_dir/host/xz-5.0.3/libtool
> ./build_dir/host/mpfr-3.0.0/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/binutils-2.22/opcodes/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/binutils-2.22/ld/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/binutils-2.22/gas/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/binutils-2.22/binutils/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/binutils-2.22/bfd/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/binutils-2.22/gprof/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/gcc-linaro-4.7-2012.04-final/lto-plugin/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/gcc-linaro-4.7-2012.04-final/zlib/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/gcc-linaro-4.7-2012.04-final/mipsel-openwrt-linux-uclibc/libstdc++-v3/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/gcc-linaro-4.7-2012.04-final/mipsel-openwrt-linux-uclibc/libquadmath/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/gdb-linaro-7.2-2011.03-0/opcodes/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/gdb-linaro-7.2-2011.03-0/bfd/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/gcc-linaro-4.7-2012.04-initial/lto-plugin/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/gcc-linaro-4.7-2012.04-initial/zlib/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/gcc-linaro-4.7-2012.04-minimal/lto-plugin/libtool
> ./build_dir/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2/gcc-linaro-4.7-2012.04-minimal/zlib/libtool
> ./package/libtool
> ./staging_dir/host/bin/libtool
> ./staging_dir/host/share/libtool
> drasko@Marx:~/carambola/carambola$
> 
> BR,
> Drasko
> _______________________________________________
> openwrt-devel mailing list
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to