Skip to content

Tracking issue for musl host toolchain #59302

Open
@mati865

Description

@mati865
Member

TODO:

For people looking how to use as it dynamic target:

RUSTFLAGS="-C target-feature=-crt-static" cargo build

Activity

added
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
O-muslTarget: The musl libc
on Mar 19, 2019
wangbj

wangbj commented on Mar 20, 2019

@wangbj

It seems x86_64-unknown-linux-musl target doesn't honor --enable-default-pie, a different behavior compare to x86_64-unknown-linux-gnu. Is this a known issue?

mati865

mati865 commented on Mar 20, 2019

@mati865
MemberAuthor

@wangbj I don't think Rust supports --enable-default-pie for any target. Could you provide more details?

wangbj

wangbj commented on Mar 20, 2019

@wangbj

hmm, the problem seems caused by musl-gcc wrapper instead of rustc:

details: https://gist.github.com/wangbj/ead5fa8c96418de7c9050bc354fbf353

--enable-default-pie is a gcc configure flag. sorry for the noise. (shortened the text to a gist).

Cogitri

Cogitri commented on May 3, 2019

@Cogitri
mati865

mati865 commented on May 5, 2019

@mati865
MemberAuthor

I knew about Alpine and Void. IMO Alpine approach is better because <arch>-unknown-linux-musl remain static by default (it behaves like upstream) and new target <arch>-alpine-linux-musl links dynamically by default.

I had looked at that PR and libc changes will be incompatible with upstream rust behaviour. Official Rust packages when statically linking to musl create executables that all fully static (run basically everywhere), that patch will create static executables that depend on musl runtime (use have to install musl to be able to run them).

Cogitri

Cogitri commented on May 5, 2019

@Cogitri

Yup, but at least on Void we've come to terms that the Rust in the repos is only really meant for packages in the repos, while users interested in rust development should use upstream Rust via rustip.

smaeul

smaeul commented on May 5, 2019

@smaeul
Contributor

I had looked at that PR and libc changes will be incompatible with upstream rust behaviour. Official Rust packages when statically linking to musl create executables that all fully static (run basically everywhere), that patch will create static executables that depend on musl runtime (use have to install musl to be able to run them).

That doesn't make sense. Static executables by definition don't depend on having musl installed. Are you referring to rust-lang/libc#1327? That change would require having a musl-targeting toolchain installed for rustc to link (static) musl-targeting binaries. But any static binaries compiled by rustc would still be totally independent and require no musl installation.

52 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCO-muslTarget: The musl libcS-tracking-impl-incompleteStatus: The implementation is incomplete.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yshui@haraldh@wesleywiser@Centril@gnzlbg

        Issue actions

          Tracking issue for musl host toolchain · Issue #59302 · rust-lang/rust