-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rust_extern_with_linkage___dso_handle+0x0): undefined reference to `__dso_handle' #140955
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
The list of dependencies for the project are:
|
You didn't provide crt objects to the linker. When calling linker directly you have to take care of it. |
I didn’t on the version that compiled. Same exact build command, same dependencies installed. Builds on 1.74, fails on 1.81. What would be the proper library to include on the linker for version 1.81? |
@tkennedy1-godaddy would you like to run cargo bisect-rustc to narrow down the rustc commit range that intoduced this change in behavior? (I don't know much about CRT myself, but bisected PR description is often insightful in these cases, in my experience) @rustbot label: +A-linkage +A-cross |
@moxian yes i can get to that this afternoon pdt |
|
Amazingly this build system was finalized in Feb 2024, so it looks like I really dodged a bullet there :) |
I think something else must have pulled the necessary objects.
Just as with C. |
The
These paths are passed in via the And more importantly, if I leave them out, the linker is unable to link to gcc_s, which is is one of the libraries located in those paths. Here's the error if I omit those
And here's the library it's looking for.
The fact that we're referring to
And has been an issue in the past, specifically in Rust makes me think something else might be going on here other than "it wasn't supported and now it's not supported at all". It might be a "it wasn't supposed to be supported and so it was an accident that it was supported" type thing, but given that even providing the correct libraries still causes this to break and the information in that gist, I'm not thoroughly convinced. |
The linker doesn't link all everything it can find inside directories provided with
Yep, that's a library linked by
I cannot give meaningful insight on that part, but maybe some Rust's ELF expert can help. |
I tried this code:
Trying to cross compile (from aarch64 to x86_86 on linux)
I expected to see this happen: explanation
The software compiled correctly.
Instead, this happened: explanation
The linker failed on trying to link Rust's libstd.
Meta
rustc --version --verbose
:Backtrace
This does work correctly on rust 1.74.0 on the same system. I have been unable to test other versions yet, nor create a self-contained example.
The build command for this is:
The text was updated successfully, but these errors were encountered: