-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Musl linker regression: undefined reference to X #61328
Comments
I have this issue too - I believe the issue is that |
Ah, that will be it! The breakage is due to changes in the grouping rules in PR #55659 |
Another casualty of rustc's bundling behaviour... |
Is there a workaround for this? I guess manually build |
My 'workaround' is to use the last working version, |
Note that this is affecting native aarch64 compilation on Alpine:
|
Unsure if this is a duplicate issue, so I'll post it here: cc: @Nilstrieb (talked about it on discord) I tried this code: (host: # .cargo/config.coml
[build]
target = "x86_64-unknown-linux-musl"
[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"] // main.rs
fn main() {
println!("{}", std::hint::black_box(45.0f64).exp());
}
I expected to see this happen: Compiles, prints a large number, and exits successfully. Instead, this happened: A linker error:
The error only happens with Full `cargo b` output
Meta
|
... where X is things like 'printf', i.e. symbols that clearly should exist.
This looks similar to other reported bugs, particularly #58163, but this one a) used to work until Rust 1.32 and b) is not embedded/no-std.
Using my
nlopt
library to reproduce. You will needmusl
installed. I am running linux/ubuntu 18.04. Disclaimer: I am no expert and I may have completely messed up how linking etc is supposed to be done.It works on this nightly:
But barfs on the next nightly:
with the following:
The text was updated successfully, but these errors were encountered: