Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 209221

Summary: sys-dev/binutils: add sysroot support to native toolchains
Product: Gentoo Linux Reporter: Angelo Leto <angleto>
Component: [OLD] Core systemAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED WONTFIX    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch for toolchain-binutils.eclass

Description Angelo Leto 2008-02-07 11:21:32 UTC
I propose to modify the eclass toolchain-binutils.eclass in order to build binutils with sysroots support. I think the sysroot USE flag should be added.



Reproducible: Always
Comment 1 Angelo Leto 2008-02-07 11:23:23 UTC
Created attachment 142866 [details, diff]
patch for toolchain-binutils.eclass

the patch add the support for sysroots for sys-devel/binutils
Comment 2 SpanKY gentoo-dev 2008-02-09 23:28:37 UTC
no real information as to what you are trying to do ... the --sysroot option should work regardless of the configure flag for it
Comment 3 Angelo Leto 2008-02-09 23:45:16 UTC
I need to use the --sysroot=<path> option in order to override the sysroot path given at configure time.
If the flag --with-sysroot is not specified at configure time ld will say:

"ld: this linker was not configured to use sysroots."

In order to make working the "--sysroot" option I used the eclass patch attached.

I reopen the bug because the ld option "--sysroot" does not work without specify --with-sysroot at configuration time.
Comment 4 SpanKY gentoo-dev 2008-02-20 04:04:26 UTC
i cant see this being useful at this time, sorry

you can easily emerge binutils with EXTRA_ECONF=--sysroot
Comment 5 SpanKY gentoo-dev 2010-12-12 17:09:39 UTC
Comment on attachment 142866 [details, diff]
patch for toolchain-binutils.eclass

for sure, bare --with-sysroot breaks things:
$ echo 'main(){}' > test.c
$ gcc test.c -lncursesw
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: warning: libdl.so.2, needed by /lib64/libncursesw.so, not found (try using -rpath or -rpath-link)
/lib64/libncursesw.so: undefined reference to `dlopen@GLIBC_2.2.5'
/lib64/libncursesw.so: undefined reference to `dlclose@GLIBC_2.2.5'
/lib64/libncursesw.so: undefined reference to `dlsym@GLIBC_2.2.5'
collect2: ld returned 1 exit status

--with-sysroot=/ works a bit better ...