Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 262042 - Fix cross-compile relink in libtool eclass
Summary: Fix cross-compile relink in libtool eclass
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 262298
  Show dependency tree
 
Reported: 2009-03-10 21:10 UTC by Sven 'sleipnir' Rebhan
Modified: 2009-07-05 19:52 UTC (History)
4 users (show)

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


Attachments
Add cross-compile patch category (libtool-crosscompile-categorie.patch,743 bytes, patch)
2009-03-10 21:17 UTC, Sven 'sleipnir' Rebhan
Details | Diff
Actual fix to libtool/ltmain.sh (2.2.6,765 bytes, patch)
2009-03-10 21:21 UTC, Sven 'sleipnir' Rebhan
Details | Diff
Reworked libtool patch (libtool-crosscompile-categorie.patch,891 bytes, patch)
2009-03-11 18:17 UTC, Sven 'sleipnir' Rebhan
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-10 21:10:48 UTC
Libtool pulls in host's /usr/lib during the relink process. The following patch does fix this using the $ROOT prefix. To do so, I introduce a cross patchdir for the libtool eclass. The libtool patch that will follow needs to be put there.

I successfully compiled both a native amd64 system and a cross-compiled armv4tl-softfloat-gnueabi base system with this patch without errors.

Reproducible: Always

Steps to Reproduce:
1. Make sure your target make.conf does not contain LDFLAGS=-L$ROOT/usr/lib or similar.
2. Try to cross emerge e.g. gmp

Actual Results:  
gmp fails during make install because libtool's relink trys to pull in /usr/lib/libm.so

Expected Results:  
gmp compiles and links against the target's libm.so
Comment 1 Sven 'sleipnir' Rebhan 2009-03-10 21:17:59 UTC
Created attachment 184614 [details, diff]
Add cross-compile patch category

Add a "cross" patch category to the $ECLASSDIR/ELT-patches directory.
WE NEED TO ALSO CREATE THAT DIR!
Comment 2 Andrei Slavoiu 2009-03-10 21:18:33 UTC
*** Bug 260794 has been marked as a duplicate of this bug. ***
Comment 3 Sven 'sleipnir' Rebhan 2009-03-10 21:21:39 UTC
Created attachment 184616 [details, diff]
Actual fix to libtool/ltmain.sh

This fixes relink in ltmain.sh. A separate bugreport for libtool-2.2.6a will follow.
Comment 4 Sven 'sleipnir' Rebhan 2009-03-10 21:22:37 UTC
Comment on attachment 184616 [details, diff]
Actual fix to libtool/ltmain.sh

This fix needs to be put into $${ECLASSDIR}/ELT-patches/cross.
Comment 5 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-03-11 05:28:30 UTC
Reassigning to base-system herd.
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-03-11 05:29:16 UTC
Whoops, fixing component as well...
Comment 7 SpanKY gentoo-dev 2009-03-11 09:32:42 UTC
seems like a sane idea in general ... but the cross patches should only be applied when tc-is-cross-compiler returns true
Comment 8 Sven 'sleipnir' Rebhan 2009-03-11 18:17:40 UTC
Created attachment 184723 [details, diff]
Reworked libtool patch

Reworked patch to use the toolchain functions instead of playing funny games with variables. Thanks for pointing this out!
Comment 9 SpanKY gentoo-dev 2009-03-14 13:02:14 UTC
your patch had whitespace damage, so i fixed that up and applied.  thanks!

http://sources.gentoo.org/eclass/libtool.eclass?r1=1.81&r2=1.82
http://sources.gentoo.org/eclass/ELT-patches/cross/link-ROOT?rev=1.1
Comment 10 Sergey Mironov 2009-06-03 06:42:10 UTC
Hi, could you explain a thing about the problem?

As i see, many packages have their own ltmain.sh and their ebuilds don't call elibtoolize. For example, i've cross-compiled gmp successfully, but caught an errors during xmerging of libgcrypt and gstreamer. Seems, that their ebuilds don't call elibtoolize at all. 

So, my question: Is there a way to  build libtool'ed packages without fixing them manually, or the only way - is to cross-compile minimal environment and use qemu to compile the rest as usual?

thanks