-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Explicitly pass -no-pie #43693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explicitly pass -no-pie #43693
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
https://github.com/emk/rust-musl-builder could help test this. |
Is that setup to build rustc itself? It needs a somewhat specialized setup with a libunwind.a as well as just MUSL. |
Ah, well the old rust buildbot images may still work: https://github.com/rust-lang/rust-buildbot/blob/master/slaves/linux/Dockerfile |
Looks good to me! There's a bunch of conditions that lead up to passing r=me w/ that tweak (if ok) and once you're happy with some testing |
Some linkers (e.g. Debian and Arch's) that are configured to make PIEs by default will make dynamically linked executables that don't actually dynamically link to anything. Fix that by explicitly passing -no-pie in those cases. Closes rust-lang#43647
This is not going to interact well with PR #40113, where pie is enabled all the time. However, there's something interesting in #40113 (comment), where pie is enabled but it actually does produce 'statically linked dynamic binaries'. For comparison, first the output from the issue that motivated this PR (#43647):
And from the 'native musl' PR:
Note there's no interpreter in the latter. Since this is something we're going to have to do anyway, it'd be nice if we could figure out how to actually generate static binaries with pie enabled. cc @shizmob |
Ah, this PR may not be needed at all then, right? |
Potentially, but I'm not sure what about the arch linker is causing it to generate binaries like that so I've no idea if it'll be fixed. Worth a shot though I suppose. |
I think I'll close this for now and check back in after #40113 lands. |
Reopening - r? @alexcrichton |
Oh, nevermind github seems unhappy with that - opening a new PR |
Some linkers (e.g. Debian and Arch's) that are configured to make PIEs
by default will make dynamically linked executables that don't actually
dynamically link to anything. Fix that by explicitly passing -no-pie in
those cases.
Closes #43647
I wasn't able to test this out manually - is there an easy way to make a suitable musl root?