diff options
author | Joshua Kiekendief <SirJosh3917@users.noreply.github.com> | 2021-05-30 23:52:14 -0700 |
---|---|---|
committer | Georgy Yakovlev <gyakovlev@gentoo.org> | 2021-05-30 23:55:41 -0700 |
commit | 92f70cd6dc23e2707a7964fd9e51753c3e8c23b6 (patch) | |
tree | 5e22811fd6a2837cfa2960e93181ec64ff3cf30c | |
parent | dev-python/identify: Bump to 2.2.7 (diff) | |
download | gentoo-92f70cd6dc23e2707a7964fd9e51753c3e8c23b6.tar.gz gentoo-92f70cd6dc23e2707a7964fd9e51753c3e8c23b6.tar.bz2 gentoo-92f70cd6dc23e2707a7964fd9e51753c3e8c23b6.zip |
dev-lang/rust: support musl cross targets
Conditionally add `musl-root` path If the target triplet ends
in `musl*`, this will use the cross-toolchain's compiler to add the
`musl-root` component. If this is not added, the sanity check panics while
building rust:
```
thread 'main' panicked at 'when targeting MUSL either the rust.musl-root option or
the target.$TARGET.musl-root option must be specified in config.toml', src/bootstrap/sanity.rs:188:25
```
Closes: https://github.com/gentoo/gentoo/pull/19806
Signed-off-by: Joshua Kiekendief <SirJosh3917@users.noreply.github.com>
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
-rw-r--r-- | dev-lang/rust/rust-1.51.0-r2.ebuild | 5 | ||||
-rw-r--r-- | dev-lang/rust/rust-1.52.1.ebuild | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/dev-lang/rust/rust-1.51.0-r2.ebuild b/dev-lang/rust/rust-1.51.0-r2.ebuild index d672d89ea660..a9c49b69bae9 100644 --- a/dev-lang/rust/rust-1.51.0-r2.ebuild +++ b/dev-lang/rust/rust-1.51.0-r2.ebuild @@ -444,6 +444,11 @@ src_configure() { llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" _EOF_ fi + if [[ "${cross_toolchain}" == *-musl* ]]; then + cat <<- _EOF_ >> "${S}"/config.toml + musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr" + _EOF_ + fi # append cross target to "normal" target list # example 'target = ["powerpc64le-unknown-linux-gnu"]' diff --git a/dev-lang/rust/rust-1.52.1.ebuild b/dev-lang/rust/rust-1.52.1.ebuild index 625bf6563a25..d8b7334db884 100644 --- a/dev-lang/rust/rust-1.52.1.ebuild +++ b/dev-lang/rust/rust-1.52.1.ebuild @@ -444,6 +444,11 @@ src_configure() { llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" _EOF_ fi + if [[ "${cross_toolchain}" == *-musl* ]]; then + cat <<- _EOF_ >> "${S}"/config.toml + musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr" + _EOF_ + fi # append cross target to "normal" target list # example 'target = ["powerpc64le-unknown-linux-gnu"]' |