Gentoo Archives: gentoo-embedded

From: Alon Bar-Lev <alonbl@g.o>
To: gentoo-embedded@l.g.o
Subject: [gentoo-embedded] Cross-compile and libtool
Date: Fri, 23 Nov 2007 14:02:48
Message-Id: 9e0cf0bf0711230601q44d1bea6j5f5681dd6fe4b3ca@mail.gmail.com
1 Hello,
2
3 I have an issue with libtool and cross compile.
4
5 When merging a library which uses libtool, it creates the .la file
6 with libdir= variable, usually it will contain /usr/lib.
7
8 When merging another package that also uses libtool and depends on the
9 library, it takes the libdir value from the .la file and link the .so
10 using absolute path. So it will be use /usr/lib/<lib>.so
11
12 Because of this behavior of libtool, trying to override the library
13 location by LDFLAGS="-L<whatever>" does not work.
14
15 I also tried to specify LDFLAGS="-Wl,--sysroot -Wl,${SYSROOT}" and
16 LDFALGS="-Wl,-rpath-link -Wl,${SYSROOT}/usr/lib" without luck.
17
18 Eventually I ended up with patching every package I use with the
19 following patch in order to make it work:
20 --- ltmain.sh.org 2007-11-23 12:28:49.000000000 +0200
21 +++ ltmain.sh 2007-11-23 12:29:07.000000000 +0200
22 @@ -7069,7 +7069,7 @@ dlopen='$dlfiles'
23 dlpreopen='$dlprefiles'
24
25 # Directory that this library needs to be installed in:
26 -libdir='$install_libdir'"
27 +libdir='$ROOT$install_libdir'"
28 if test "$installed" = no && test "$need_relink" = yes; then
29 $ECHO >> $output "\
30 relink_command=\"$relink_command\""
31
32
33 But I don't believe I am the first one who has this problem, and the
34 idea of patching each package seems not right. I expect the <cross>-ld
35 to pre-append the cross root to every absolute path.
36
37 Best Regards,
38 Alon Bar-Lev.
39 --
40 gentoo-embedded@g.o mailing list

Replies

Subject Author
Re: [gentoo-embedded] Cross-compile and libtool Enrico Weigelt <weigelt@×××××.de>
Re: [gentoo-embedded] Cross-compile and libtool Mike Frysinger <vapier@g.o>