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 libusb-0.1.12-r5.build 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
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)
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/libusb.so ) 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
vapier needs to look at this bug. The problem here is multi-fold.
erp did not mean to close this bug.
The error goes back to the change from the manual creation of usr/lib/libusb.so 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/libusb.so now contains GROUP (/lib/libusb-0.1.so.4) instead of (/lib/libusb.so) 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"
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/libusb-0.1.so.4 However, if we change GROUP ( /lib/libusb-0.1.so.4 ) in $ROOT/usr/lib/libusb.so to GROUP ( =/lib/libusb-0.1.so.4 ) in $ROOT/usr/lib/libusb.so 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.
too many wrong/incorrect statements here ... but whatever, i'll look into it
gen_usr_ldscript is correct *** This bug has been marked as a duplicate of bug 275666 ***