commit:     5d1d59ae42f8cd426b981009358a7f727d80a191
Author:     Michal Rostecki <vadorovsky <AT> protonmail <DOT> com>
AuthorDate: Wed Aug  6 19:28:17 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug  6 20:05:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d1d59ae

llvm-runtimes/libcxx: Set CTARGET to CHOST if the package is not cross

The multilib eclass doesn't set the CTARGET. Therefore, using CTARGET
was breaking the multilib builds. At the same time, using CTARGET is
necessary for crossdev to work.

The long term solution should be fixing multilib eclass, but for now,
make sure that CTARGET is correct inside the ebuild.

Bug: https://bugs.gentoo.org/961153
Signed-off-by: Michal Rostecki <vadorovsky <AT> protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/43361
Closes: https://github.com/gentoo/gentoo/pull/43361
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 llvm-runtimes/libcxx/libcxx-19.1.7.ebuild      | 6 ++++++
 llvm-runtimes/libcxx/libcxx-20.1.8.ebuild      | 6 ++++++
 llvm-runtimes/libcxx/libcxx-21.1.0.9999.ebuild | 6 ++++++
 llvm-runtimes/libcxx/libcxx-22.0.0.9999.ebuild | 6 ++++++
 4 files changed, 24 insertions(+)

diff --git a/llvm-runtimes/libcxx/libcxx-19.1.7.ebuild 
b/llvm-runtimes/libcxx/libcxx-19.1.7.ebuild
index c5649f641a28..ba28fd0cc10a 100644
--- a/llvm-runtimes/libcxx/libcxx-19.1.7.ebuild
+++ b/llvm-runtimes/libcxx/libcxx-19.1.7.ebuild
@@ -84,6 +84,12 @@ src_configure() {
 }
 
 multilib_src_configure() {
+       # Workaround for bgo #961153.
+       # TODO: Fix the multilib.eclass, so it sets CTARGET properly.
+       if ! is_crosspkg; then
+               export CTARGET=${CHOST}
+       fi
+
        if use clang; then
                llvm_prepend_path -b "${LLVM_MAJOR}"
                local -x CC=${CTARGET}-clang

diff --git a/llvm-runtimes/libcxx/libcxx-20.1.8.ebuild 
b/llvm-runtimes/libcxx/libcxx-20.1.8.ebuild
index ac2a1dba2e07..1923c444ad3c 100644
--- a/llvm-runtimes/libcxx/libcxx-20.1.8.ebuild
+++ b/llvm-runtimes/libcxx/libcxx-20.1.8.ebuild
@@ -86,6 +86,12 @@ src_configure() {
 }
 
 multilib_src_configure() {
+       # Workaround for bgo #961153.
+       # TODO: Fix the multilib.eclass, so it sets CTARGET properly.
+       if ! is_crosspkg; then
+               export CTARGET=${CHOST}
+       fi
+
        if use clang; then
                llvm_prepend_path -b "${LLVM_MAJOR}"
                local -x CC=${CTARGET}-clang

diff --git a/llvm-runtimes/libcxx/libcxx-21.1.0.9999.ebuild 
b/llvm-runtimes/libcxx/libcxx-21.1.0.9999.ebuild
index 935dea8bfb0f..aadd7774d65e 100644
--- a/llvm-runtimes/libcxx/libcxx-21.1.0.9999.ebuild
+++ b/llvm-runtimes/libcxx/libcxx-21.1.0.9999.ebuild
@@ -85,6 +85,12 @@ src_configure() {
 }
 
 multilib_src_configure() {
+       # Workaround for bgo #961153.
+       # TODO: Fix the multilib.eclass, so it sets CTARGET properly.
+       if ! is_crosspkg; then
+               export CTARGET=${CHOST}
+       fi
+
        if use clang; then
                llvm_prepend_path -b "${LLVM_MAJOR}"
                local -x CC=${CTARGET}-clang

diff --git a/llvm-runtimes/libcxx/libcxx-22.0.0.9999.ebuild 
b/llvm-runtimes/libcxx/libcxx-22.0.0.9999.ebuild
index 935dea8bfb0f..aadd7774d65e 100644
--- a/llvm-runtimes/libcxx/libcxx-22.0.0.9999.ebuild
+++ b/llvm-runtimes/libcxx/libcxx-22.0.0.9999.ebuild
@@ -85,6 +85,12 @@ src_configure() {
 }
 
 multilib_src_configure() {
+       # Workaround for bgo #961153.
+       # TODO: Fix the multilib.eclass, so it sets CTARGET properly.
+       if ! is_crosspkg; then
+               export CTARGET=${CHOST}
+       fi
+
        if use clang; then
                llvm_prepend_path -b "${LLVM_MAJOR}"
                local -x CC=${CTARGET}-clang

Reply via email to