-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
x86_64-unknown-linux-musl target and main-returning-Result produces a dynamically-linked executable instead of a statically linked one. #54243
Comments
Is this repros on |
I think there's various things going on here:
|
@bossmc Hmm, I'm pretty sure it's already using And yea, just working around it now by using the bundled version for now. |
Can you run the |
Ah ok, you were right, it was indeed just invoking A bit unfortunate but the bundled feature does actually map to more what I want. Thanks @bossmc |
gcc/ld will create a dynamically-linked executable without warning, even when passed `-static`, when asked to link to a `.so`. Avoid this confusing and unintended behavior by always using the static version of libraries when trying to link static executables. Fixes rust-lang#54243
gcc/ld will create a dynamically-linked executable without warning, even when passed `-static`, when asked to link to a `.so`. Avoid this confusing and unintended behavior by always using the static version of libraries when trying to link static executables. Fixes rust-lang#54243
gcc/ld will create a dynamically-linked executable without warning, even when passed `-static`, when asked to link to a `.so`. Avoid this confusing and unintended behavior by always using the static version of libraries when trying to link static executables. Fixes rust-lang#54243
gcc/ld will create a dynamically-linked executable without warning, even when passed `-static`, when asked to link to a `.so`. Avoid this confusing and unintended behavior by always using the static version of libraries when trying to link static executables. Fixes rust-lang#54243
On ELF targets like Linux, gcc/ld will create a dynamically-linked executable without warning, even when passed `-static`, when asked to link to a `.so`. Avoid this confusing and unintended behavior by always using the static version of libraries when trying to link static executables. Fixes rust-lang#54243
On ELF targets like Linux, gcc/ld will create a dynamically-linked executable without warning, even when passed `-static`, when asked to link to a `.so`. Avoid this confusing and unintended behavior by always using the static version of libraries when trying to link static executables. Fixes rust-lang#54243
On ELF targets like Linux, gcc/ld will create a dynamically-linked executable without warning, even when passed `-static`, when asked to link to a `.so`. Avoid this confusing and unintended behavior by always using the static version of libraries when trying to link static executables. Fixes rust-lang#54243
On ELF targets like Linux, gcc/ld will create a dynamically-linked executable without warning, even when passed `-static`, when asked to link to a `.so`. Avoid this confusing and unintended behavior by always using the static version of libraries when trying to link static executables. Fixes rust-lang#54243
On ELF targets like Linux, gcc/ld will create a dynamically-linked executable without warning, even when passed `-static`, when asked to link to a `.so`. Avoid this confusing and unintended behavior by always using the static version of libraries when trying to link static executables. Fixes rust-lang#54243
I've run into this weird interaction between the musl target, diesel, returning Result from main and debug vs release mode.
The setup:
Cargo.toml:
main.rs:
Now if we take this simple innocuous looking program and try to run it:
Well, the file is definitely there but running
file
gives this:That's odd, I would've expected a statically linked binary but file disagrees here. The no such file or directory error I'm guessing results from the bogus program interpreter in the elf header:
That path doesn't exist on my machine.
Now, the weird thing is a couple different things workaround the issue:
fn main() { ... }
function.rustc/cargo version:
EDIT: Repros on stable.
The text was updated successfully, but these errors were encountered: