1 |
commit: cac0e35d84c5c8460b2c11ef4aa36ff3004d234c |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 23 00:39:16 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 23 00:41:07 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cac0e35d |
7 |
|
8 |
sys-libs/compiler-rt: only override compiler for USE=clang if not using Clang |
9 |
|
10 |
When USE=clang, we used to force CC=${CHOST}-clang, CXX=${CHOST}-clang++, |
11 |
but this prevents overriding with a certain version of Clang. |
12 |
|
13 |
In my case, a world upgrade went awry where Clang got upgraded from 13->14, |
14 |
but compiler-rt hadn't yet been upgraded to the new slot, so my system |
15 |
Clang was broken. CC=clang-13 CXX=clang++-13 emerge -v1 ... sorted out |
16 |
the issue. |
17 |
|
18 |
So, don't override CC & CXX to be Clang if we know it's already Clang. |
19 |
|
20 |
That said, we probably still need to tweak the logic for when |
21 |
the compiler fails (for which we already have checks in the ebuild). |
22 |
|
23 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
24 |
|
25 |
sys-libs/compiler-rt/compiler-rt-14.0.4.ebuild | 9 +++++++-- |
26 |
sys-libs/compiler-rt/compiler-rt-14.0.5.ebuild | 8 ++++++-- |
27 |
sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild | 8 ++++++-- |
28 |
3 files changed, 19 insertions(+), 6 deletions(-) |
29 |
|
30 |
diff --git a/sys-libs/compiler-rt/compiler-rt-14.0.4.ebuild b/sys-libs/compiler-rt/compiler-rt-14.0.4.ebuild |
31 |
index ff1e80b30fff..9a03b0678000 100644 |
32 |
--- a/sys-libs/compiler-rt/compiler-rt-14.0.4.ebuild |
33 |
+++ b/sys-libs/compiler-rt/compiler-rt-14.0.4.ebuild |
34 |
@@ -72,8 +72,13 @@ src_configure() { |
35 |
|
36 |
local nolib_flags=( -nodefaultlibs -lc ) |
37 |
if use clang; then |
38 |
- local -x CC=${CHOST}-clang |
39 |
- local -x CXX=${CHOST}-clang++ |
40 |
+ # Only do this conditionally to allow overriding with |
41 |
+ # e.g. CC=clang-13 in case of breakage |
42 |
+ if ! tc-is-clang ; then |
43 |
+ local -x CC=${CHOST}-clang |
44 |
+ local -x CXX=${CHOST}-clang++ |
45 |
+ fi |
46 |
+ |
47 |
strip-unsupported-flags |
48 |
# ensure we can use clang before installing compiler-rt |
49 |
local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |
50 |
|
51 |
diff --git a/sys-libs/compiler-rt/compiler-rt-14.0.5.ebuild b/sys-libs/compiler-rt/compiler-rt-14.0.5.ebuild |
52 |
index dcbada06ccf0..e5c0203110f9 100644 |
53 |
--- a/sys-libs/compiler-rt/compiler-rt-14.0.5.ebuild |
54 |
+++ b/sys-libs/compiler-rt/compiler-rt-14.0.5.ebuild |
55 |
@@ -72,8 +72,12 @@ src_configure() { |
56 |
|
57 |
local nolib_flags=( -nodefaultlibs -lc ) |
58 |
if use clang; then |
59 |
- local -x CC=${CHOST}-clang |
60 |
- local -x CXX=${CHOST}-clang++ |
61 |
+ # Only do this conditionally to allow overriding with |
62 |
+ # e.g. CC=clang-13 in case of breakage |
63 |
+ if ! tc-is-clang ; then |
64 |
+ local -x CC=${CHOST}-clang |
65 |
+ local -x CXX=${CHOST}-clang++ |
66 |
+ fi |
67 |
strip-unsupported-flags |
68 |
# ensure we can use clang before installing compiler-rt |
69 |
local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |
70 |
|
71 |
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 |
72 |
index 1a7cc5f2b724..c6913b149fa4 100644 |
73 |
--- a/sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild |
74 |
+++ b/sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild |
75 |
@@ -72,8 +72,12 @@ src_configure() { |
76 |
|
77 |
local nolib_flags=( -nodefaultlibs -lc ) |
78 |
if use clang; then |
79 |
- local -x CC=${CHOST}-clang |
80 |
- local -x CXX=${CHOST}-clang++ |
81 |
+ # Only do this conditionally to allow overriding with |
82 |
+ # e.g. CC=clang-13 in case of breakage |
83 |
+ if ! tc-is-clang ; then |
84 |
+ local -x CC=${CHOST}-clang |
85 |
+ local -x CXX=${CHOST}-clang++ |
86 |
+ fi |
87 |
strip-unsupported-flags |
88 |
# ensure we can use clang before installing compiler-rt |
89 |
local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |