-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix linking issues when using multiple codegen units #53
Comments
I've also seen cargo/xargo emit entirely empty binaries unless this property is set. |
@thejpster with the cortex-m-rt linker script or with some other custom linker script? I have patched the cortex-m-rt linker script a few times to make it work with multiple codegen units but I wouldn't be surprised if there are still issues out there ... |
This was with stellaris-launchpad, which had its own linker script dating back to my original C implementation. Would it be useful if we wrote up requirements for linker scripts somewhere, rather than relying on some magic in one example? |
The empty binaries, on Windows, may be related to this bug under heavy load: |
@thejpster all the magic is documented in cortex-m-rt's linker script. All the symbols in that linker script are documented as well. |
That is beautifully done, but I still wonder if it's worth pulling out into something that's more generic and not Cortex-M specific, to help people with other platforms and improve discoverability. |
PR rust-lang/rust#49316 should fix this. (merged) |
Update: rust-lang/rust#49316 didn't quite fix this. See rust-lang/rust#49316 (comment). |
Update: rust-lang/rust#49672 should fix this for real |
Fixed in rust-lang/rust#49672. 🎉 |
To improve build times rustc is now defaulting to building crates using multiple codegen units. The
problem is that using multiple codegen units can sometimes break linking of no-std applications
("undefined reference to
rust_begin_unwind
").We are looking for someone who can help us fix the problem in the compiler
Tasks
solution is described in Multiple codegen units breaks linking: "undefined reference to rust_begin_unwind" rust-lang/rust#47074 (comment)
The current workaround for this issue is to force the compiler to use a single codegen unit in
Cargo.toml
The text was updated successfully, but these errors were encountered: