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
Created attachment 142866 [details, diff] patch for toolchain-binutils.eclass the patch add the support for sysroots for sys-devel/binutils
no real information as to what you are trying to do ... the --sysroot option should work regardless of the configure flag for it
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.
i cant see this being useful at this time, sorry you can easily emerge binutils with EXTRA_ECONF=--sysroot
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 ...