Skip to content
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

Compatibility issue with rust 1.82. #862

Open
kareled opened this issue Aug 26, 2024 · 3 comments
Open

Compatibility issue with rust 1.82. #862

kareled opened this issue Aug 26, 2024 · 3 comments
Labels
type: bug Something isn't working

Comments

@kareled
Copy link

kareled commented Aug 26, 2024

Hello,
not sure where to log it, but with update to 1.82 nightly my project link fails with missing __defmt_default_panic␍

The project builds for armv7emhf and it links fine code unchanged with various rustc toolchains up to including 1.81 nightly. Always using nightly due to RTIC usage. With nightly from 2024-08-03 (my first obtained nightly of 1.82 family) it starts to complain and fail while being linked with:

  = note: rust-lld: error: C:\Users\gardas\git\develop\target\thumbv7em-none-eabihf\debug\build\defmt-e20cffcd2d13aae7\out\defmt.x:7: symbol not found: __defmt_default_panic␍
          rust-lld: error: C:\Users\gardas\git\develop\target\thumbv7em-none-eabihf\debug\build\defmt-e20cffcd2d13aae7\out\defmt.x:7: symbol not found: __defmt_default_panic␍
          rust-lld: error: C:\Users\gardas\git\develop\target\thumbv7em-none-eabihf\debug\build\defmt-e20cffcd2d13aae7\out\defmt.x:7: symbol not found: __defmt_default_panic␍
          rust-lld: error: C:\Users\gardas\git\develop\target\thumbv7em-none-eabihf\debug\build\defmt-e20cffcd2d13aae7\out\defmt.x:7: symbol not found: __defmt_default_panic␍

          flip-link: the native linker failed to link the program normally; please check your project configuration and linker scripts

If this is not defmt issue, please recommend where to report it while closing. Thanks!

@Urhengulas Urhengulas added the type: bug Something isn't working label Aug 27, 2024
@skade
Copy link

skade commented Oct 8, 2024

This is due to upstream bug rust-lang/rust#131164

@Urhengulas
Copy link
Member

@Dirbaio said:

A possible workaround defmt could do is adding EXTERN(_defmt_panic) to the linker script. The side effect is it'd prevent the panic handler from being optimized out when it's truly unused, I think.

I can confirm this works as a workaround on current beta. Let's hope it won't be necessary, but if the upstream fix does not make it into stable we can use it.

@Urhengulas
Copy link
Member

It probably should be EXTERN(__defmt_default_panic) instead of EXTERN(_defmt_panic)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
@skade @Urhengulas @kareled and others