Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 262298 - Make dev-build/libtool-2.2.6a cross-compile aware during relink
Summary: Make dev-build/libtool-2.2.6a cross-compile aware during relink
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
: 272089 273910 275462 446182 555260 555332 (view as bug list)
Depends on: 262042
  Show dependency tree
Reported: 2009-03-12 20:02 UTC by Sven 'sleipnir' Rebhan
Modified: 2024-01-15 16:40 UTC (History)
17 users (show)

See Also:
Package list:
Runtime testing required: ---

Libtool fix (libtool-2.2.6a-add-cross-compile-root-to-libdir.patch,765 bytes, patch)
2009-03-12 20:04 UTC, Sven 'sleipnir' Rebhan
Details | Diff
Patch for the libtool ebuild (libtool-2.2.6a-cross-compile-relink.patch,696 bytes, patch)
2009-03-12 20:07 UTC, Sven 'sleipnir' Rebhan
Details | Diff
Improved libtool fix (libtool-2.2.6a-add-cross-compile-root-to-libdir.patch,1.07 KB, patch)
2009-03-14 14:13 UTC, Sven 'sleipnir' Rebhan
Details | Diff
new ELT-patches/cross/link-ROOT (link-ROOT,1.06 KB, patch)
2010-02-04 08:22 UTC, Peter Levine
Details | Diff
cross-compile link root patch (libtool_cross-compile_link_root_fix.patch,1.14 KB, patch)
2011-03-01 09:12 UTC, Henrik Korkuc
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven 'sleipnir' Rebhan 2009-03-12 20:02:09 UTC
The libtool adds various directories to the library search patch during the relink phase. This behaviour makes cross-compilation life very hard.

Reproducible: Always

Steps to Reproduce:
Comment 1 Sven 'sleipnir' Rebhan 2009-03-12 20:04:53 UTC
Created attachment 184826 [details, diff]
Libtool fix

Add the directory of the target instead of the host to the search patch.
Comment 2 Sven 'sleipnir' Rebhan 2009-03-12 20:07:19 UTC
Created attachment 184827 [details, diff]
Patch for the libtool ebuild

This uses the libtool patch in the ebuild.
Comment 3 SpanKY gentoo-dev 2009-03-12 22:47:22 UTC
libtool changes get propagated to all packages that use libtool, even the ones outside of the tree.  changing it like this will break things.
Comment 4 Sven 'sleipnir' Rebhan 2009-03-13 18:18:12 UTC
Would it help to only patch that in for cross-compilation? What kind of patch would have a chance to get accepted by you? As I said, this fixes alot of problems seen during cross-compilation for alot of packages, so please give me at least a chance to find a proper solution.
Comment 5 SpanKY gentoo-dev 2009-03-13 19:42:41 UTC
relying on variables that only exist on Gentoo (or inside of portage) will not work.  that is what elibtoolize is for.

if you're interested in a general/correct solution, cross-compile / DESTDIR threads have been posted to the libtool mailing lists multiple times
Comment 6 Sven 'sleipnir' Rebhan 2009-03-14 14:13:20 UTC
Created attachment 184947 [details, diff]
Improved libtool fix

This patch uses native libtool variables to make the libtool cross-compile aware during the relink phase.
Comment 7 SpanKY gentoo-dev 2009-03-14 14:38:51 UTC
hmm, i like that patch.  how many packages have you tested with it ?  it'll only show up if you emerge libtool with that patch, and then emerge a package that runs libtool during src_unpack to regenerate autotool files ...
Comment 8 Sven 'sleipnir' Rebhan 2009-03-15 15:54:28 UTC
Yeah, exactly. I tested this version of libtool against emerging a base system using our Openmoko profile:

It is now possible to cross-compile all those packages (ok some of them need additional patches) without specifying -L$ROOT/usr/lib etc. as LDFLAGS.

A good example of a package requiring the patch is libusb. Without the libtool patch it fails during the relink phase. However, the patch here is somehow complementary to the libtool.eclass fix.
Comment 9 Sven 'sleipnir' Rebhan 2009-03-26 20:35:25 UTC
Any news on this? SpanKY do you want me to modify the patch or something?
Comment 10 Chris Verges 2009-04-30 15:41:18 UTC
Any progress on this?  The gap between crossdev and libtool causes a lot of headaches when doing a cross compile.
Comment 11 Sergey Mironov 2009-06-02 05:57:56 UTC
*** Bug 272089 has been marked as a duplicate of this bug. ***
Comment 12 SpanKY gentoo-dev 2009-07-05 19:25:20 UTC
*** Bug 275462 has been marked as a duplicate of this bug. ***
Comment 13 SpanKY gentoo-dev 2009-07-05 19:32:46 UTC
*** Bug 273910 has been marked as a duplicate of this bug. ***
Comment 14 Anush Elangovan 2009-08-06 23:18:00 UTC
I hit this same problem cross-compiling libusb and gdbm  for the ARM similar to what others have reported (and duped to this bug). Anyway we can get this patch applied to the libtool ebuild? 

Comment 15 Peter Levine 2010-02-04 08:22:00 UTC
Created attachment 218371 [details, diff]
new ELT-patches/cross/link-ROOT

This seems to solve the problem in dev-libs/mpfr and dev-libs/ppl.

Please test.
Comment 16 SpanKY gentoo-dev 2010-02-06 01:21:33 UTC
Comment on attachment 218371 [details, diff]
new ELT-patches/cross/link-ROOT

libtool has to use POSIX shell syntax.  things like [[ ... ]] are bashisms.
Comment 17 Markos Chandras (RETIRED) gentoo-dev 2011-02-13 00:26:52 UTC
Any progress?
Comment 18 Henrik Korkuc 2011-03-01 09:12:27 UTC
Created attachment 264231 [details, diff]
cross-compile link root patch

I rewrote P. Levine's patch. I hope it now will comply to POSIX.

BTW there are packages, which ship in source and for successful cross-compiling this patch is needed. Should I open bug report for each of this package with patch?
Comment 19 SpanKY gentoo-dev 2011-03-16 03:58:26 UTC
Comment on attachment 264231 [details, diff]
cross-compile link root patch

not really.  not all packages using libtool need this.  if there is a package which you *know* needs it, then opening a bug so that it calls `elibtoolize` would be fine.  but that can only be done once this gets added to the ELT dir.

i dont think assuming ROOT makes sense.  what i've always done is simply delete the -L path.
-    add_dir="-L$libdir"
+    add_dir=""

the toolchain should already know which lib paths to search.
Comment 20 Yixun Lan archtester gentoo-dev 2011-04-14 22:10:54 UTC
Comment 21 Jacob Godserv 2011-08-16 17:37:43 UTC
This bug is idling. Is this bug not assigned correctly?

(In reply to comment #6)
> Created attachment 184947 [details, diff]
> Improved libtool fix

What's the status on getting this patch into the tree?
Comment 22 SpanKY gentoo-dev 2012-12-21 06:14:41 UTC
*** Bug 446182 has been marked as a duplicate of this bug. ***
Comment 23 Pacho Ramos gentoo-dev 2015-08-04 16:46:45 UTC
*** Bug 555260 has been marked as a duplicate of this bug. ***
Comment 24 Pacho Ramos gentoo-dev 2015-08-04 16:49:11 UTC
*** Bug 555332 has been marked as a duplicate of this bug. ***