-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
compiler-builtins doesn't link on AVR with debug assertions #116817
Comments
I think you managed to compile compiler-builtins with debug assertions enabled. The problem is not with the linker, but that compiler-builtins structurally cannot depend on How exactly are you compiling this?
|
Actually maybe LLVM has the optimizations required for this now. You're using a nightly that is rather old, it's the same version as current stable. Can you try out the latest nightly? |
I opened #116832 for at least some of the panics that could be optimized out. |
I'm using this config cat .cargo/config.toml [target.'cfg(target_arch = "avr")'] [unstable] cat cargo.toml . [profile.dev] [profile.release] I use cargo build And I updated the compiler and I still have the same issue |
Thanks, that helps a lot. #113923 straightens out the behavior of LTO on the compiler-builtins crate. I think that fixes some of these linker errors. It doesn't get you to compiling with this config, but it removes one of the reasons I think. If I turn off LTO, I get two linker errors. One of them is a legitimate panic path in The other has panic paths that can be optimized out but aren't. I do not know if this is the same optimization that @DianQK is working on for #116832 |
avr-gcc
failed
Wow, so much panic can be removed. It looks like some different optimizations. |
You could try building with following options (there might be spurious warnings that "profile package spec ... did not match any packages"): [profile.dev.package.compiler_builtins]
debug-assertions = false
overflow-checks = false
[profile.release.package.compiler_builtins]
debug-assertions = false
overflow-checks = false The compiler-builtins crate needs to be built in a specific way. Unfortunately this does not happen out of the box with -Z build-std at the moment. |
it's work, thank you
|
I used just [profile.dev.package.compiler_builtins] |
Thanks for checking. The issue that "compiler-builtins" should be built with special flags is already tracked in rust-lang/wg-cargo-std-aware#28. |
I tried this code:
can you help me to find out what is the issue?
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: