Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 615030 - dev-lang/rust - add support for static linking / x86_64-unknown-linux-musl
Summary: dev-lang/rust - add support for static linking / x86_64-unknown-linux-musl
Status: RESOLVED WONTFIX
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: 2017-04-09 00:41 UTC by Dennis Schridde
Modified: 2020-02-22 10:36 UTC (History)
3 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 Dennis Schridde 2017-04-09 00:41:33 UTC
Static linking of Rust binaries is supported on the x86_64-unknown-linux-musl target only: https://doc.rust-lang.org/book/advanced-linking.html

It would be great if Gentoo would (optionally) build Rust with support for the x86_64-unknown-linux-musl target.

Please note that this is not related to bug #598892.
Comment 1 Oleg 2017-08-23 20:21:26 UTC
Was it merged into master today https://github.com/rust-lang/rust/pull/40113
Comment 2 Dennis Schridde 2017-08-23 21:12:55 UTC
(In reply to Oleg from comment #1)
> Was it merged into master today https://github.com/rust-lang/rust/pull/40113

I think that PR covers dynamic linking with x86_64-unknown-linux-musl?  And in any case, Gentoo needs to support the additional target, before this can be used.
Comment 3 Samuel Holland 2017-09-13 18:38:24 UTC
(In reply to Dennis Schridde from comment #0)
> It would be great if Gentoo would (optionally) build Rust with support for
> the x86_64-unknown-linux-musl target.

Building a rustc that can target musl requires having musl available for linking libstd, so that would make dev-lang/rust depend on sys-libs/musl. Unfortunately, sys-libs/musl conflicts with glibc.
Comment 4 Georgy Yakovlev archtester gentoo-dev 2020-02-22 10:36:14 UTC
not going to implement this as an additional target for ::gentoo rust, however on musl hosts rust works nowadays (rust and rust-bin) and can emit static libraries.
while not very convenient, you can have a musl chroot with rust-bin, it will produce static binaries by default.