diff options
author | Sam James <sam@gentoo.org> | 2022-06-23 01:39:16 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-06-23 01:41:07 +0100 |
commit | cac0e35d84c5c8460b2c11ef4aa36ff3004d234c (patch) | |
tree | 4affec521cdb46b02b6bb03a55e7f35519b93d33 | |
parent | dev-libs/libpeas: Add Python 3.11 compatibility (diff) | |
download | gentoo-cac0e35d84c5c8460b2c11ef4aa36ff3004d234c.tar.gz gentoo-cac0e35d84c5c8460b2c11ef4aa36ff3004d234c.tar.bz2 gentoo-cac0e35d84c5c8460b2c11ef4aa36ff3004d234c.zip |
sys-libs/compiler-rt: only override compiler for USE=clang if not using Clang
When USE=clang, we used to force CC=${CHOST}-clang, CXX=${CHOST}-clang++,
but this prevents overriding with a certain version of Clang.
In my case, a world upgrade went awry where Clang got upgraded from 13->14,
but compiler-rt hadn't yet been upgraded to the new slot, so my system
Clang was broken. CC=clang-13 CXX=clang++-13 emerge -v1 ... sorted out
the issue.
So, don't override CC & CXX to be Clang if we know it's already Clang.
That said, we probably still need to tweak the logic for when
the compiler fails (for which we already have checks in the ebuild).
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | sys-libs/compiler-rt/compiler-rt-14.0.4.ebuild | 9 | ||||
-rw-r--r-- | sys-libs/compiler-rt/compiler-rt-14.0.5.ebuild | 8 | ||||
-rw-r--r-- | sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild | 8 |
3 files changed, 19 insertions, 6 deletions
diff --git a/sys-libs/compiler-rt/compiler-rt-14.0.4.ebuild b/sys-libs/compiler-rt/compiler-rt-14.0.4.ebuild index ff1e80b30fff..9a03b0678000 100644 --- a/sys-libs/compiler-rt/compiler-rt-14.0.4.ebuild +++ b/sys-libs/compiler-rt/compiler-rt-14.0.4.ebuild @@ -72,8 +72,13 @@ src_configure() { local nolib_flags=( -nodefaultlibs -lc ) if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ + # Only do this conditionally to allow overriding with + # e.g. CC=clang-13 in case of breakage + if ! tc-is-clang ; then + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + fi + strip-unsupported-flags # ensure we can use clang before installing compiler-rt local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" diff --git a/sys-libs/compiler-rt/compiler-rt-14.0.5.ebuild b/sys-libs/compiler-rt/compiler-rt-14.0.5.ebuild index dcbada06ccf0..e5c0203110f9 100644 --- a/sys-libs/compiler-rt/compiler-rt-14.0.5.ebuild +++ b/sys-libs/compiler-rt/compiler-rt-14.0.5.ebuild @@ -72,8 +72,12 @@ src_configure() { local nolib_flags=( -nodefaultlibs -lc ) if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ + # Only do this conditionally to allow overriding with + # e.g. CC=clang-13 in case of breakage + if ! tc-is-clang ; then + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + fi strip-unsupported-flags # ensure we can use clang before installing compiler-rt local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" diff --git a/sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild b/sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild index 1a7cc5f2b724..c6913b149fa4 100644 --- a/sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild +++ b/sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild @@ -72,8 +72,12 @@ src_configure() { local nolib_flags=( -nodefaultlibs -lc ) if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ + # Only do this conditionally to allow overriding with + # e.g. CC=clang-13 in case of breakage + if ! tc-is-clang ; then + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + fi strip-unsupported-flags # ensure we can use clang before installing compiler-rt local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |