Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 598892 - dev-lang/rust: Add Musl Support
Summary: dev-lang/rust: Add Musl Support
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Rust Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-04 01:44 UTC by Aric Belsito
Modified: 2017-09-13 18:50 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aric Belsito 2016-11-04 01:44:29 UTC
At the moment, it is impossible to build rust for musl because the only bootstrap tarballs available are dynamically linked for glibc.

Upstream Bug:
https://github.com/rust-lang/rust/issues/31322

New Development:
https://github.com/rust-lang/rust/pull/37545
Comment 1 Jonas Stein gentoo-dev 2016-11-04 11:17:51 UTC
Aric, how can a gentoo developer help here? As far I could see this option is not yet in the upstream tar ball, right?
Comment 2 Samuel Holland 2017-09-13 18:50:00 UTC
I managed to get most of musl support upstream for the 1.21 release currently in beta (the PR is at https://github.com/rust-lang/rust/pull/40113).

Backports of the PR and a few additional patches needed for bootstrapping are in my copy of the rust repository at https://github.com/smaeul/rust.

stage0 tarballs for all architectures supported by rust+musl (armv6 and older) are at https://portage.smaeul.xyz/distfiles/. These have statically-linked LLVM and libstdc++ (the only dependency for rustc is libc.so), so they should be usable directly by Gentoo.

The cargo in the tarballs does depend on a few shared libraries. It can be linked fully statically (so it would work on both glibc and musl regardless of installed libraries), but only if is built separately from rustc. I have done this for x86_64; that's the cargo at the URL above without a file extension.

ebuilds for cargo and rust that work for amd64 and *should* work for other architectures (maybe minor adjustments to CTARGET needed) are in the overlay at https://github.com/smaeul/portage-overlay. The ebuilds should also work for glibc.