-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
-C self-contained=yes creates programs that crash on startup (on linux-gnu targets) #103576
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
Comments
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Nov 11, 2022
…d, r=petrochenkov Issue error when -C link-self-contained option is used on unsupported platforms The documentation was also updated to reflect this. I'm assuming the supported platforms are the same as initially written in [RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md#compiler-17). Fixes rust-lang#103576
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Nov 11, 2022
…d, r=petrochenkov Issue error when -C link-self-contained option is used on unsupported platforms The documentation was also updated to reflect this. I'm assuming the supported platforms are the same as initially written in [RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md#compiler-17). Fixes rust-lang#103576
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Nov 11, 2022
…d, r=petrochenkov Issue error when -C link-self-contained option is used on unsupported platforms The documentation was also updated to reflect this. I'm assuming the supported platforms are the same as initially written in [RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md#compiler-17). Fixes rust-lang#103576
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 16, 2022
…d, r=bjorn3 Issue error when -C link-self-contained option is used on unsupported platforms The documentation was also updated to reflect this. I'm assuming the supported platforms are the same as initially written in [RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md#compiler-17). Fixes rust-lang#103576
Thanks for fixing this, @StackDoubleFlow ! |
Aaron1011
pushed a commit
to Aaron1011/rust
that referenced
this issue
Jan 6, 2023
…d, r=bjorn3 Issue error when -C link-self-contained option is used on unsupported platforms The documentation was also updated to reflect this. I'm assuming the supported platforms are the same as initially written in [RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md#compiler-17). Fixes rust-lang#103576
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiling and running a "hello world" with the
-C self-contained=yes
option onx64_64-unknown-linux-gnu
results in:This happens with any rust version I tried, in particular
rustc 1.64.0 (a55dd71d5 2022-09-19)
.Looking into more details reveals:
So what appears to happen is that there are no startup objects available in self-contained mode for the target, therefore no startup objects participate in the link command, and therefore the entry point symbol in the final ELF executable is set to some random address, causing the crash on startup.
Now, the RELEASES.md file states that
link-self-contained
is not supported on linux-gnu (glibc) targets. I assume this is still true (the "normal" documentation apparently doesn't say)?Even so, I guess it would still be much preferable to issue an error (or even just ignore the option), rather than silently creating broken binaries.
The text was updated successfully, but these errors were encountered: