commit: 92f70cd6dc23e2707a7964fd9e51753c3e8c23b6 Author: Joshua Kiekendief <SirJosh3917 <AT> users <DOT> noreply <DOT> github <DOT> com> AuthorDate: Mon May 31 06:52:14 2021 +0000 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> CommitDate: Mon May 31 06:55:41 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92f70cd6
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 <AT> users.noreply.github.com> Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> dev-lang/rust/rust-1.51.0-r2.ebuild | 5 +++++ dev-lang/rust/rust-1.52.1.ebuild | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/dev-lang/rust/rust-1.51.0-r2.ebuild b/dev-lang/rust/rust-1.51.0-r2.ebuild index d672d89ea66..a9c49b69bae 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 625bf6563a2..d8b7334db88 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"]'
