1 |
commit: f522845a9404611765279f3e2ca28e519abbf182 |
2 |
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 29 11:33:38 2023 +0000 |
4 |
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 29 11:33:38 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f522845a |
7 |
|
8 |
sys-devel/lld: Fix cross-compiling with -DLLVM_TABLEGEN_EXE |
9 |
|
10 |
The Clang approach of using -DLLVM_TOOLS_BINARY_DIR does not work here. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/891993 |
13 |
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org> |
14 |
|
15 |
sys-devel/lld/lld-15.0.7.ebuild | 12 +++++++++++- |
16 |
sys-devel/lld/lld-16.0.0.9999.ebuild | 12 +++++++++++- |
17 |
sys-devel/lld/lld-16.0.0_pre20230107.ebuild | 12 +++++++++++- |
18 |
sys-devel/lld/lld-16.0.0_pre20230127.ebuild | 12 +++++++++++- |
19 |
sys-devel/lld/lld-17.0.0.9999.ebuild | 12 +++++++++++- |
20 |
5 files changed, 55 insertions(+), 5 deletions(-) |
21 |
|
22 |
diff --git a/sys-devel/lld/lld-15.0.7.ebuild b/sys-devel/lld/lld-15.0.7.ebuild |
23 |
index 7bccf83c3662..6156f9bae682 100644 |
24 |
--- a/sys-devel/lld/lld-15.0.7.ebuild |
25 |
+++ b/sys-devel/lld/lld-15.0.7.ebuild |
26 |
@@ -4,7 +4,7 @@ |
27 |
EAPI=8 |
28 |
|
29 |
PYTHON_COMPAT=( python3_{9..11} ) |
30 |
-inherit cmake flag-o-matic llvm llvm.org python-any-r1 |
31 |
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs |
32 |
|
33 |
DESCRIPTION="The LLVM linker (link editor)" |
34 |
HOMEPAGE="https://llvm.org/" |
35 |
@@ -69,12 +69,22 @@ src_configure() { |
36 |
-DLLVM_INCLUDE_TESTS=$(usex test) |
37 |
-DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" |
38 |
) |
39 |
+ |
40 |
use test && mycmakeargs+=( |
41 |
-DLLVM_BUILD_TESTS=ON |
42 |
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
43 |
-DLLVM_LIT_ARGS="$(get_lit_flags)" |
44 |
-DPython3_EXECUTABLE="${PYTHON}" |
45 |
) |
46 |
+ |
47 |
+ if tc-is-cross-compiler; then |
48 |
+ has_version -b sys-devel/llvm:${LLVM_MAJOR} || |
49 |
+ die "sys-devel/llvm:${LLVM_MAJOR} is required on the build host." |
50 |
+ mycmakeargs+=( |
51 |
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen" |
52 |
+ ) |
53 |
+ fi |
54 |
+ |
55 |
cmake_src_configure |
56 |
} |
57 |
|
58 |
|
59 |
diff --git a/sys-devel/lld/lld-16.0.0.9999.ebuild b/sys-devel/lld/lld-16.0.0.9999.ebuild |
60 |
index a540e3ab0cb3..c23949899ce7 100644 |
61 |
--- a/sys-devel/lld/lld-16.0.0.9999.ebuild |
62 |
+++ b/sys-devel/lld/lld-16.0.0.9999.ebuild |
63 |
@@ -4,7 +4,7 @@ |
64 |
EAPI=8 |
65 |
|
66 |
PYTHON_COMPAT=( python3_{9..11} ) |
67 |
-inherit cmake flag-o-matic llvm llvm.org python-any-r1 |
68 |
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs |
69 |
|
70 |
DESCRIPTION="The LLVM linker (link editor)" |
71 |
HOMEPAGE="https://llvm.org/" |
72 |
@@ -69,11 +69,21 @@ src_configure() { |
73 |
-DBUILD_SHARED_LIBS=ON |
74 |
-DLLVM_INCLUDE_TESTS=$(usex test) |
75 |
) |
76 |
+ |
77 |
use test && mycmakeargs+=( |
78 |
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
79 |
-DLLVM_LIT_ARGS="$(get_lit_flags)" |
80 |
-DPython3_EXECUTABLE="${PYTHON}" |
81 |
) |
82 |
+ |
83 |
+ if tc-is-cross-compiler; then |
84 |
+ has_version -b sys-devel/llvm:${LLVM_MAJOR} || |
85 |
+ die "sys-devel/llvm:${LLVM_MAJOR} is required on the build host." |
86 |
+ mycmakeargs+=( |
87 |
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen" |
88 |
+ ) |
89 |
+ fi |
90 |
+ |
91 |
cmake_src_configure |
92 |
} |
93 |
|
94 |
|
95 |
diff --git a/sys-devel/lld/lld-16.0.0_pre20230107.ebuild b/sys-devel/lld/lld-16.0.0_pre20230107.ebuild |
96 |
index a540e3ab0cb3..c23949899ce7 100644 |
97 |
--- a/sys-devel/lld/lld-16.0.0_pre20230107.ebuild |
98 |
+++ b/sys-devel/lld/lld-16.0.0_pre20230107.ebuild |
99 |
@@ -4,7 +4,7 @@ |
100 |
EAPI=8 |
101 |
|
102 |
PYTHON_COMPAT=( python3_{9..11} ) |
103 |
-inherit cmake flag-o-matic llvm llvm.org python-any-r1 |
104 |
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs |
105 |
|
106 |
DESCRIPTION="The LLVM linker (link editor)" |
107 |
HOMEPAGE="https://llvm.org/" |
108 |
@@ -69,11 +69,21 @@ src_configure() { |
109 |
-DBUILD_SHARED_LIBS=ON |
110 |
-DLLVM_INCLUDE_TESTS=$(usex test) |
111 |
) |
112 |
+ |
113 |
use test && mycmakeargs+=( |
114 |
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
115 |
-DLLVM_LIT_ARGS="$(get_lit_flags)" |
116 |
-DPython3_EXECUTABLE="${PYTHON}" |
117 |
) |
118 |
+ |
119 |
+ if tc-is-cross-compiler; then |
120 |
+ has_version -b sys-devel/llvm:${LLVM_MAJOR} || |
121 |
+ die "sys-devel/llvm:${LLVM_MAJOR} is required on the build host." |
122 |
+ mycmakeargs+=( |
123 |
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen" |
124 |
+ ) |
125 |
+ fi |
126 |
+ |
127 |
cmake_src_configure |
128 |
} |
129 |
|
130 |
|
131 |
diff --git a/sys-devel/lld/lld-16.0.0_pre20230127.ebuild b/sys-devel/lld/lld-16.0.0_pre20230127.ebuild |
132 |
index a540e3ab0cb3..c23949899ce7 100644 |
133 |
--- a/sys-devel/lld/lld-16.0.0_pre20230127.ebuild |
134 |
+++ b/sys-devel/lld/lld-16.0.0_pre20230127.ebuild |
135 |
@@ -4,7 +4,7 @@ |
136 |
EAPI=8 |
137 |
|
138 |
PYTHON_COMPAT=( python3_{9..11} ) |
139 |
-inherit cmake flag-o-matic llvm llvm.org python-any-r1 |
140 |
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs |
141 |
|
142 |
DESCRIPTION="The LLVM linker (link editor)" |
143 |
HOMEPAGE="https://llvm.org/" |
144 |
@@ -69,11 +69,21 @@ src_configure() { |
145 |
-DBUILD_SHARED_LIBS=ON |
146 |
-DLLVM_INCLUDE_TESTS=$(usex test) |
147 |
) |
148 |
+ |
149 |
use test && mycmakeargs+=( |
150 |
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
151 |
-DLLVM_LIT_ARGS="$(get_lit_flags)" |
152 |
-DPython3_EXECUTABLE="${PYTHON}" |
153 |
) |
154 |
+ |
155 |
+ if tc-is-cross-compiler; then |
156 |
+ has_version -b sys-devel/llvm:${LLVM_MAJOR} || |
157 |
+ die "sys-devel/llvm:${LLVM_MAJOR} is required on the build host." |
158 |
+ mycmakeargs+=( |
159 |
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen" |
160 |
+ ) |
161 |
+ fi |
162 |
+ |
163 |
cmake_src_configure |
164 |
} |
165 |
|
166 |
|
167 |
diff --git a/sys-devel/lld/lld-17.0.0.9999.ebuild b/sys-devel/lld/lld-17.0.0.9999.ebuild |
168 |
index a540e3ab0cb3..c23949899ce7 100644 |
169 |
--- a/sys-devel/lld/lld-17.0.0.9999.ebuild |
170 |
+++ b/sys-devel/lld/lld-17.0.0.9999.ebuild |
171 |
@@ -4,7 +4,7 @@ |
172 |
EAPI=8 |
173 |
|
174 |
PYTHON_COMPAT=( python3_{9..11} ) |
175 |
-inherit cmake flag-o-matic llvm llvm.org python-any-r1 |
176 |
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs |
177 |
|
178 |
DESCRIPTION="The LLVM linker (link editor)" |
179 |
HOMEPAGE="https://llvm.org/" |
180 |
@@ -69,11 +69,21 @@ src_configure() { |
181 |
-DBUILD_SHARED_LIBS=ON |
182 |
-DLLVM_INCLUDE_TESTS=$(usex test) |
183 |
) |
184 |
+ |
185 |
use test && mycmakeargs+=( |
186 |
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
187 |
-DLLVM_LIT_ARGS="$(get_lit_flags)" |
188 |
-DPython3_EXECUTABLE="${PYTHON}" |
189 |
) |
190 |
+ |
191 |
+ if tc-is-cross-compiler; then |
192 |
+ has_version -b sys-devel/llvm:${LLVM_MAJOR} || |
193 |
+ die "sys-devel/llvm:${LLVM_MAJOR} is required on the build host." |
194 |
+ mycmakeargs+=( |
195 |
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen" |
196 |
+ ) |
197 |
+ fi |
198 |
+ |
199 |
cmake_src_configure |
200 |
} |