-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Issue bootstrapping x86_64-unknown-linux-musl - using -static when linking llvm dynamic library #103199
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
Comments
This looks related to #108878. In general, our linkage situation on MUSL is ... dubious. See https://rust-lang.zulipchat.com/#narrow/stream/233931-xxx/topic/Update.20the.20existing.20musl.20targets.20to.20be.20dy.E2.80.A6.20compiler-team.23422 for some past discussion - looks like that never ended up happening, not sure what the current status is. |
I'm curious to know if adding |
I threw in |
What happens if you add The relevant code that adds |
That being said, there should really be some sort of check before LLVM is even configured that errors out if |
That was the trick, now I'm able to complete the compilation. I never had to change that value for other platforms. I also had to take out the |
Yes, Rust defaults to I think there's a potential diagnostics enhancement to be extracted from this; haven't thought hard enough about whether that would be the same enhancement(s) suggested in #110511 or not. |
I'm using Debian 10 trying to bootstrap x86_64-unknown-linux-musl.
https://github.com/lancethepants/rust-bootstrap-x86_64-unknown-linux-musl
I've bootstrapped other platforms using musl libc but haven't encountered this issue. Near the end of compiling llvm for the target when everything is linking I get this and other issues like this. The issue seems to be that
-static
is being passed to the link invocation when creating a dynamic library which is pulling in several static libraries. The-static
shouldn't be in there and when I manually run the command without it it links just fine. The-static
is causing the linker to want to pull in crtbeginT.o when what we really need is crtbeginS.o.-shared
is also provided later on in the link, but that doesn't seem to counter the -static.Looking through the source I'm not sure where the
-static
is being pulled in.In
compiler/rustc_codegen_ssa/src/back/linker.rs
there is a reference toStaticDylib
that invokes-static
. I've tried removing that but that didn't seem to work, though I don't know if it's using the pre-compiled toolchain downloaded when bootstrapping or the newly createdx86_64-unknown-linux-gnu
version that is built during this bootstrap process. Thex86_64-unknown-linux-gnu
toolchain it creates in the bootstrap process doesn't have-static
when llvm is being linked for that target, so seems like a musl thing maybe.The text was updated successfully, but these errors were encountered: