Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 266319 - `gen_usr_ldscript -a` seems to break sysroot linkage
Summary: `gen_usr_ldscript -a` seems to break sysroot linkage
Status: RESOLVED DUPLICATE of bug 275666
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
Depends on:
Reported: 2009-04-16 00:05 UTC by Maksim 'max_posedon' Melnikau
Modified: 2009-07-05 19:57 UTC (History)
2 users (show)

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

libusb-0.1.12-r5.ebuild patch (libusb-0.1.12-r5.ebuild.patch,544 bytes, patch)
2009-04-16 00:06 UTC, Maksim 'max_posedon' Melnikau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maksim 'max_posedon' Melnikau 2009-04-16 00:05:23 UTC
if $ROOT/lib/lib<name>.so is missing, and you trying fix bug #4411, gcc will never links correct (during cross compilation). 

$ROOT/lib/lib<name>.so files really important for working -lusr (with "LDFLAGS=-L$ROOT/lib -L$ROOT/usr/lib")

vaiper, so you try change "classic" way of fixint it in broke hal cross compliation for example

Reproducible: Always

Steps to Reproduce:
1. emerge-cross... libusb
2. emerge-cross... hal

Actual Results:  
compilation fails

Expected Results:  
compilation shouldn't fail
Comment 1 Maksim 'max_posedon' Melnikau 2009-04-16 00:06:57 UTC
Created attachment 188512 [details, diff]
libusb-0.1.12-r5.ebuild patch

sample for patch which one should apply for fix it (old fation way)
Comment 2 Maksim 'max_posedon' Melnikau 2009-04-16 00:16:05 UTC
may be report isn't clear, one more explanation:

missing $ROOT/lib/lib<name>.so is bad
because any program that links using -lusb
will find $ROOT/usr/lib/lib<name>.so
with GROUP ( /lib/ )
fail here

even -L$ROOT/lib can't helps, because lib<name>.so just missing
ok, I'll try add few comments with explanation)

IF $ROOT/lib/lib<name>.so is present
-lusb -L$ROOT/lib<name>.so find $ROOT/lib/lib<name>.so (before! $ROOT/usr/lib/lib<name>.so) and compilation will be successful
Comment 3 solar (RETIRED) gentoo-dev 2009-04-16 16:32:43 UTC
vapier needs to look at this bug. The problem here is multi-fold.
Comment 4 solar (RETIRED) gentoo-dev 2009-04-16 18:22:02 UTC
erp did not mean to close this bug.
Comment 5 Sven 'sleipnir' Rebhan 2009-04-16 20:49:53 UTC
The error goes back to the change from the manual creation of usr/lib/ using "gen_usr_ld libusb" to the automatic creation using "gen_usr_ld -a usb". There are two major changes, at least one affecting cross-compilation:

1. usr/lib/ now contains GROUP (/lib/ instead of (/lib/ due to the use of tlib in the toolchain-func.eclass.

2. (and this one affects cross-compilation) the automatic section of gen_usr_ld in the toolchain-func.eclass contains the line "rm -f "${D}"/${libdir}/${lib}" which makes it impossible to hack around libusb via LDFLAGS="-L${ROOT}/lib"
Comment 6 Sven 'sleipnir' Rebhan 2009-04-16 22:31:56 UTC
Just another heads-up:
Without the fix and without having libusb installed to the buildhost you get:

/usr/libexec/gcc/armv4tl-softfloat-linux-gnueabi/ld: cannot find /lib/

However, if we change 

GROUP ( /lib/ )  in $ROOT/usr/lib/
GROUP ( =/lib/ ) in $ROOT/usr/lib/

e.g. hal compiles fine against the otherwise same version of libusb. From the ld manpage on --library-path=searchdir:
    If  searchdir  begins with "=", then the "=" will be replaced by the
    sysroot prefix, a path specified when the linker is configured.

Maybe we can use this to kill bug 4411 once and forever also for us cross-compile guys.
Comment 7 SpanKY gentoo-dev 2009-04-18 17:19:33 UTC
too many wrong/incorrect statements here ... but whatever, i'll look into it
Comment 8 SpanKY gentoo-dev 2009-07-05 19:57:51 UTC
gen_usr_ldscript is correct

*** This bug has been marked as a duplicate of bug 275666 ***