commit:     44d2dbd6db9e05f156a81a3a360ff48e2ac9d773
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  2 16:25:10 2025 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Fri Jan  3 17:54:17 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44d2dbd6

toolchain.eclass: Don't prefixify dynamic linker for cross-compilers

Cross environments within a prefixed system do not have a nested prefix,
i.e. they are located at ${EPREFIX}/usr/${CHOST}, not
${EPREFIX}/usr/${CHOST}/${EPREFIX}. Binaries built with the
cross-compiler should therefore get an unprefixed dynamic linker path by
default so that they work out of the box with QEMU's -L option.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 85b5a2b23392..d85994855704 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -721,7 +721,7 @@ toolchain_src_prepare() {
 
        gnuconfig_update
 
-       if ! use prefix-guest && [[ -n ${EPREFIX} ]] ; then
+       if ! is_crosscompile && ! use prefix-guest && [[ -n ${EPREFIX} ]] ; then
                einfo "Prefixifying dynamic linkers..."
                for f in gcc/config/*/*linux*.h ; do
                        ebegin "  Updating ${f}"

Reply via email to