1 |
commit: 92f70cd6dc23e2707a7964fd9e51753c3e8c23b6 |
2 |
Author: Joshua Kiekendief <SirJosh3917 <AT> users <DOT> noreply <DOT> github <DOT> com> |
3 |
AuthorDate: Mon May 31 06:52:14 2021 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 31 06:55:41 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92f70cd6 |
7 |
|
8 |
dev-lang/rust: support musl cross targets |
9 |
|
10 |
Conditionally add `musl-root` path If the target triplet ends |
11 |
in `musl*`, this will use the cross-toolchain's compiler to add the |
12 |
`musl-root` component. If this is not added, the sanity check panics while |
13 |
building rust: |
14 |
|
15 |
``` |
16 |
thread 'main' panicked at 'when targeting MUSL either the rust.musl-root option or |
17 |
the target.$TARGET.musl-root option must be specified in config.toml', src/bootstrap/sanity.rs:188:25 |
18 |
``` |
19 |
|
20 |
Closes: https://github.com/gentoo/gentoo/pull/19806 |
21 |
Signed-off-by: Joshua Kiekendief <SirJosh3917 <AT> users.noreply.github.com> |
22 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
23 |
|
24 |
dev-lang/rust/rust-1.51.0-r2.ebuild | 5 +++++ |
25 |
dev-lang/rust/rust-1.52.1.ebuild | 5 +++++ |
26 |
2 files changed, 10 insertions(+) |
27 |
|
28 |
diff --git a/dev-lang/rust/rust-1.51.0-r2.ebuild b/dev-lang/rust/rust-1.51.0-r2.ebuild |
29 |
index d672d89ea66..a9c49b69bae 100644 |
30 |
--- a/dev-lang/rust/rust-1.51.0-r2.ebuild |
31 |
+++ b/dev-lang/rust/rust-1.51.0-r2.ebuild |
32 |
@@ -444,6 +444,11 @@ src_configure() { |
33 |
llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" |
34 |
_EOF_ |
35 |
fi |
36 |
+ if [[ "${cross_toolchain}" == *-musl* ]]; then |
37 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
38 |
+ musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr" |
39 |
+ _EOF_ |
40 |
+ fi |
41 |
|
42 |
# append cross target to "normal" target list |
43 |
# example 'target = ["powerpc64le-unknown-linux-gnu"]' |
44 |
|
45 |
diff --git a/dev-lang/rust/rust-1.52.1.ebuild b/dev-lang/rust/rust-1.52.1.ebuild |
46 |
index 625bf6563a2..d8b7334db88 100644 |
47 |
--- a/dev-lang/rust/rust-1.52.1.ebuild |
48 |
+++ b/dev-lang/rust/rust-1.52.1.ebuild |
49 |
@@ -444,6 +444,11 @@ src_configure() { |
50 |
llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" |
51 |
_EOF_ |
52 |
fi |
53 |
+ if [[ "${cross_toolchain}" == *-musl* ]]; then |
54 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
55 |
+ musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr" |
56 |
+ _EOF_ |
57 |
+ fi |
58 |
|
59 |
# append cross target to "normal" target list |
60 |
# example 'target = ["powerpc64le-unknown-linux-gnu"]' |