Repository navigation
non-pub function no longer compiled in debug profile, causing link errors on thumbv7em-none-eabihf with defmt #131164
Copy link
Copy link
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Milestone
Description
Code
I tried this code:
$ git clone https://github.com/ferrous-systems/rust-exercises.git
$ cd rust-exercises
$ git checkout v1.17.0
$ cd nrf52_code/radio_app
$ rustup target add thumbv7em-none-eabihf --toolchain=nightly
$ cargo install flip-link (or change `.cargo/config.toml` to not use flip-link - either is fine)
$ cargo +nightly buildI expected to see this happen:
The binaries build like, they do on stable.
Instead, this happened:
= note: rust-lld: error: /Users/jonathan/Documents/clients/training/open-rust-embedded-2024-10-02/rust-exercises-v1.17.0/nrf52-code/radio-app/target/thumbv7em-none-eabihf/debug/build/defmt-36a2ab5d209daca3/out/defmt.x:7: symbol not found: __defmt_default_panic
rust-lld: error: /Users/jonathan/Documents/clients/training/open-rust-embedded-2024-10-02/rust-exercises-v1.17.0/nrf52-code/radio-app/target/thumbv7em-none-eabihf/debug/build/defmt-36a2ab5d209daca3/out/defmt.x:7: symbol not found: __defmt_default_panic
rust-lld: error: /Users/jonathan/Documents/clients/training/open-rust-embedded-2024-10-02/rust-exercises-v1.17.0/nrf52-code/radio-app/target/thumbv7em-none-eabihf/debug/build/defmt-36a2ab5d209daca3/out/defmt.x:7: symbol not found: __defmt_default_panic
rust-lld: error: /Users/jonathan/Documents/clients/training/open-rust-embedded-2024-10-02/rust-exercises-v1.17.0/nrf52-code/radio-app/target/thumbv7em-none-eabihf/debug/build/defmt-36a2ab5d209daca3/out/defmt.x:7: symbol not found: __defmt_default_panic
That symbol is defined here: https://github.com/knurling-rs/defmt/blob/b7a89f56059fc66ac3c7cc3445d092829599e699/defmt/src/lib.rs#L365
Bisect
@Dirbaio said:
searched nightlies: from nightly-2024-07-30 to nightly-2024-10-02
regressed nightly: nightly-2024-08-01
searched commit range: f8060d2...28a58f2
regressed commit: 0b5eb7b
That's the LLVM 19 upgrade.
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Activity
Dirbaio commentedon Oct 2, 2024
it regressed both with and without --release.
jonathanpallant commentedon Oct 2, 2024
I also ran a bisect:
searched nightlies: from nightly-2024-07-01 to nightly-2024-10-02
regressed nightly: nightly-2024-08-01
searched commit range: f8060d2...28a58f2
regressed commit: 0b5eb7b
apiraino commentedon Oct 2, 2024
WG-prioritization assigning priority (Zulip discussion).
I can also reproduce on current beta so tagging accordingly
@rustbot label -I-prioritize +P-medium +regression-from-stable-to-beta
Dirbaio commentedon Oct 2, 2024
minimized, zero deps -> https://github.com/Dirbaio/defmt-repro
Dirbaio commentedon Oct 2, 2024
maybe related: llvm/llvm-project@ebb326a
32 remaining items
Urhengulas commentedon Oct 16, 2024
Do you think there is a chance that this "bug" will come back to us? We are currently evaluating if we should apply a fix/safeguard in defmt.
dianqk commentedon Oct 16, 2024
No. The main branch of LLVM has fixed. The next major update will include it.
Urhengulas commentedon Oct 16, 2024
Perfect!
thejpster commentedon Oct 16, 2024
Lgtm
jannic commentedon Oct 16, 2024
Also tried with the stable prerelease from https://internals.rust-lang.org/t/rust-1-82-0-pre-release-testing/21705. Problem is solved.
Add a test case for rust-lang#131164
Rollup merge of rust-lang#132036 - DianQK:test-131164, r=jieyouxu
Auto merge of rust-lang#132042 - matthiaskrgr:rollup-eloj566, r=matth…
Auto merge of rust-lang#132036 - DianQK:test-131164, r=<try>
Add a test case for rust-lang#131164
Rollup merge of rust-lang#132036 - DianQK:test-131164, r=jieyouxu
Rollup merge of rust-lang#132036 - DianQK:test-131164, r=jieyouxu
Auto merge of rust-lang#132079 - fmease:rollup-agrd358, r=fmease
Unrolled build for rust-lang#132036