Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926775 - dev-lang/rust fails cross-compilation to musl hosts
Summary: dev-lang/rust fails cross-compilation to musl hosts
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Randy Barlow
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2024-03-11 16:54 UTC by jonys
Modified: 2024-03-11 16:56 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
A patch for dev-lang/rust/rust-1.75.0-r1.ebuild adding musl-root to config.toml (file_926775.txt,319 bytes, patch)
2024-03-11 16:54 UTC, jonys
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jonys 2024-03-11 16:54:52 UTC
Created attachment 887368 [details, diff]
A patch for dev-lang/rust/rust-1.75.0-r1.ebuild adding musl-root to config.toml

When cross-compiling dev-lang/rust-1.74.1 or dev-lang/rust-1.75.0-r1 using the `system-bootstrap` method for hosts that use musl libc (e.g. aarch64-gentoo-linux-musl, but also others), the build fails with the following message:
```
running sanity check
thread 'main' panicked at sanity.rs:232:25:
when targeting MUSL either the rust.musl-root option or the target.$TARGET.musl-root option must be specified in config.toml
```

Steps to reproduce:
1. Install and set up crossdev for aarch64-gentoo-linux-musl
2. Install Rust with LLVM_TARGETS="AArch64"
3. Run `USE='dist system-bootstrap' LLVM_TARGETS='X86' aarch64-gentoo-linux-musl-emerge =dev-lang/rust-1.75.0-r1`

The fix is to emit the proper musl-root directive when creating config.toml in the ebuild, see the attached patch.

Signed-off-by: Jonáš Vidra <vidra@ufal.mff.cuni.cz>