diff options
author | James Le Cuirot <chewi@gentoo.org> | 2025-01-03 16:58:12 +0000 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2025-01-18 21:51:41 +0000 |
commit | 95989aaa274f30e42d00828e16fbe5c4c73c9299 (patch) | |
tree | 0f876331be16f0a6c99671ae5a4cf204f8b41b29 /sys-libs | |
parent | dev-ada/gpr: drop 23.0.0 add 25.0.0 (diff) | |
download | gentoo-95989aaa274f30e42d00828e16fbe5c4c73c9299.tar.gz gentoo-95989aaa274f30e42d00828e16fbe5c4c73c9299.tar.bz2 gentoo-95989aaa274f30e42d00828e16fbe5c4c73c9299.zip |
sys-libs/glibc: Fix cross-compiling glibc when clang is selected
binutils-config returns the wrong binary path for cross-compilers unless you
specify both the CHOST (actually CBUILD in this case) and CTARGET.
Cross-compilers do not have the bare binary names (e.g. gcc) in the binary path
returned by gcc-config, but the tuple-prefixed names are always present.
Tested with a cross build and a native build.
Closes: https://github.com/gentoo/gentoo/pull/39966
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/glibc/glibc-2.40-r7.ebuild | 10 | ||||
-rw-r--r-- | sys-libs/glibc/glibc-9999.ebuild | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/sys-libs/glibc/glibc-2.40-r7.ebuild b/sys-libs/glibc/glibc-2.40-r7.ebuild index 66f7383c954d..e7b5d78134bb 100644 --- a/sys-libs/glibc/glibc-2.40-r7.ebuild +++ b/sys-libs/glibc/glibc-2.40-r7.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -609,13 +609,13 @@ setup_env() { # Last, we need the settings of the *build* environment, not of the # target environment... - local current_binutils_path=$(env ROOT="${BROOT}" binutils-config -B) + local current_binutils_path=$(env CHOST="${CBUILD}" ROOT="${BROOT}" binutils-config -B "${CTARGET}") local current_gcc_path=$(env ROOT="${BROOT}" gcc-config -B) einfo "Overriding clang configuration, since it won't work here" - export CC="${current_gcc_path}/gcc" - export CPP="${current_gcc_path}/cpp" - export CXX="${current_gcc_path}/g++" + export CC="${current_gcc_path}/${CTARGET}-gcc" + export CPP="${current_gcc_path}/${CTARGET}-cpp" + export CXX="${current_gcc_path}/${CTARGET}-g++" export LD="${current_binutils_path}/ld.bfd" export AR="${current_binutils_path}/ar" export AS="${current_binutils_path}/as" diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index 39f4cd3f2872..b331be70e2de 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -615,13 +615,13 @@ setup_env() { # Last, we need the settings of the *build* environment, not of the # target environment... - local current_binutils_path=$(env ROOT="${BROOT}" binutils-config -B) + local current_binutils_path=$(env CHOST="${CBUILD}" ROOT="${BROOT}" binutils-config -B "${CTARGET}") local current_gcc_path=$(env ROOT="${BROOT}" gcc-config -B) einfo "Overriding clang configuration, since it won't work here" - export CC="${current_gcc_path}/gcc" - export CPP="${current_gcc_path}/cpp" - export CXX="${current_gcc_path}/g++" + export CC="${current_gcc_path}/${CTARGET}-gcc" + export CPP="${current_gcc_path}/${CTARGET}-cpp" + export CXX="${current_gcc_path}/${CTARGET}-g++" export LD="${current_binutils_path}/ld.bfd" export AR="${current_binutils_path}/ar" export AS="${current_binutils_path}/as" |