-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Undefined symbols when bootstrapping with ld.gold in DragonFly BSD #139425
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
For more context (see the zulip thread)
|
Closing this, as it is a gold issue. To resolve this, use a different maintained linker like GNU ld (BFD), or lld. |
Maybe we could do a check that gold isn't used as linker. We might want to do the same for the ld-classic on macOS given recently discovered bugs. The fastest and most reliable method I can think of is to check the |
That would be cool, especially when we start emitting |
Make #[used(linker)] the default on ELF too `#[used]` currently is an alias for `#[used(linker)]` on all platforms except ELF based ones where it is an alias for `#[used(compiler)]`. The latter has surprising behavior and the LLVM LangRef explicitly states that it "should only be used in rare circumstances, and should not be exposed to source languages." [^2] The reason `#[used]` still was an alias to `#[used(compiler)]` on ELF is because the gold linker has issues with it. Luckily gold has been deprecated with GCC 15 [^1] and seems to be unable to bootstrap rustc anyway [^3]. As such we shouldn't really care about supporting gold. This would also allow re-enabling start-stop-gc with lld. cc #93798 Likely fixes #85045 [^1]: https://lists.gnu.org/archive/html/info-gnu/2025-02/msg00001.html [^2]: https://llvm.org/docs/LangRef.html#the-llvm-compiler-used-global-variable [^3]: #139425
Make #[used(linker)] the default on ELF too `#[used]` currently is an alias for `#[used(linker)]` on all platforms except ELF based ones where it is an alias for `#[used(compiler)]`. The latter has surprising behavior and the LLVM LangRef explicitly states that it "should only be used in rare circumstances, and should not be exposed to source languages." [^2] The reason `#[used]` still was an alias to `#[used(compiler)]` on ELF is because the gold linker has issues with it. Luckily gold has been deprecated with GCC 15 [^1] and seems to be unable to bootstrap rustc anyway [^3]. As such we shouldn't really care about supporting gold. This would also allow re-enabling start-stop-gc with lld. cc rust-lang/rust#93798 Likely fixes rust-lang/rust#85045 [^1]: https://lists.gnu.org/archive/html/info-gnu/2025-02/msg00001.html [^2]: https://llvm.org/docs/LangRef.html#the-llvm-compiler-used-global-variable [^3]: rust-lang/rust#139425
Summary
TL;DR: When building rust 1.82 onwards and trying to link the
rustc_driver
with ld.gold, it will fail with the following error:Full story on Zulip: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/__rust_alloc_error_handler_should_panic.20not.20defined/with/510418013
Command used
Rust +1.82 bootstrapped with a custom script.
Expected behaviour
The build to succeed.
Actual behaviour
Fails to build, see summary.
Bootstrap configuration (bootstrap.toml)
<config>
Operating system
DragonFly BSD 6.4 and above (including bleeding edge).
HEAD
Any Rust version from 1.82 and above.
Additional context
Build Log
The text was updated successfully, but these errors were encountered: