Closed skrb-io closed 8 months ago
I confirm this is indeed broken on current nighly. it might be related to https://github.com/rust-lang/rust/issues/44322 but more investigation is still required at this stage.
I bisected this build error using cargo-bisect-rustc. The first bad commit was 8c2b57721728233e074db69d93517614de338055. https://github.com/rust-lang/rust/issues/118559 reports a regression in that commit that matches ours well enough that I assume it's the same issue.
Indeed, and there seem to be a PR attempting to fix something relate: https://github.com/rust-lang/rust/pull/118568
With a bit a luck it might be fixed in the next couple of days.
Could you provide reproduction steps? I'm not sure #118568 will fix this.
Sorry, I thought this was an issue filed to rust.
~Could you provide reproduction steps? I'm not sure #118568 will fix this.~ Sorry, I thought this was an issue filed to rust.
Still a good question:
rustup toolchain add nightly-2023-12-04 --target thumbv6m-none-eabi
git clone https://github.com/rp-rs/rp2040-project-template
cd rp2040-project-template
cargo +nightly-2023-12-04 build --target thumbv6m-none-eabi --release
warning: Linking globals named '__addsf3': symbol multiply defined!
error: failed to load bitcode of module "rp2040_hal-33611457b63b1605.rp2040_hal.a08e78ef3bbbf4e6-cgu.0.rcgu.o":
warning: `rp2040-project-template` (bin "rp2040-project-template") generated 1 warning
error: could not compile `rp2040-project-template` (bin "rp2040-project-template") due to 1 previous error; 1 warning emitted
I can verify that https://github.com/rust-lang/rust/pull/118568 did not fix the issue. Could you please create a new issue of rust?
Checked with stable, beta & nightly. This is now resolved. 🎉
Building the rp2040 project template without any alterations with rust nightly results in an error caused by lto = 'fat' optimization
It is possible that I am missing something, but changing lto = 'thin' seems to solve the issue albeit resulting in a larger binary size.