Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 267833 - sys-apps/openrc build adds -L/lib to linker command line, breaking cross compilation.
Summary: sys-apps/openrc build adds -L/lib to linker command line, breaking cross comp...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-29 05:25 UTC by Nick Bowler
Modified: 2009-05-05 01:04 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Bowler 2009-04-29 05:25:51 UTC
The openrc build unconditionally adds -L/lib and -Wl,-rpath=/lib when linking.  This causes problems when cross compiling (setting ROOT= for emerge), since it links against libraries in the main system rather than those in the target.

In this specific instance, I am compiling on an x86_64-pc-linux-gnu system for an x86_64-pc-linux-uclibc one (I suspect the problem would not occur if the target arch was different).

The build error is as follows:
x86_64-pc-linux-uclibc-gcc -Wl,-O1 -L../librc -L../libeinfo   -Wl,-rpath=/lib -L/lib  -o rc checkpath.o fstabinfo.o mountinfo.o start-stop-daemon.o rc-applets.o rc-depend.o rc-logger.o rc-misc.o rc-plugin.o rc-service.o rc-status.o rc-update.o runscript.o rc.o -lutil -lrc -leinfo -lncurses -Wl,-Bdynamic -ldl 
/usr/libexec/gcc/x86_64-pc-linux-uclibc/ld: warning: libc.so.6, needed by /lib/libncurses.so, may conflict with libc.so.0
/usr/libexec/gcc/x86_64-pc-linux-uclibc/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS definition in /usr/x86_64-pc-linux-uclibc/lib/libc.so.0 section .bss
/lib/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
Comment 1 Roy Marples 2009-05-02 17:29:39 UTC
This is fixed upstream, thanks