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

rust: add workaround for potential compiler bug #1158

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

benma
Copy link
Collaborator

@benma benma commented Dec 29, 2023

Apply workaround for a potential miscompilation bug: See

This workaround is one of three suggested alternatives. The other two are:

  • Downgrade the Rust toolchain - dismissed as it is harder to do, as it involves re-building the Docker image
  • Switch from opt-level='z' to opt-level='s' - this increases the binary size by 74416 bytes for the Multi, which is much more than the workaround in this commit.

@benma benma requested a review from Beerosagos December 29, 2023 14:26
Apply workaround for a potential miscompilation bug:
See
- rust-embedded/cortex-m#503
- rust-lang/rust#118867
We have not observed any abnormal behavior even though we fulfil all the criteria to be affected
(opt-level='z', thumbv7em-none-eabi target, Rust toolchain 1.74.0 being >= 1.73.0), but we apply
the workaround just in case.
This increases the binary size of the `make firmware` (Multi) build by
11568 bytes at the time of
adding this workaround. This can be removed again once the issue above is fixed and we have
updated to a Rust toolchain that contains the fix.

This workaround is one of three suggested alternatives. The other two
are:
- Downgrade the Rust toolchain - dismissed as it is harder to do, as
  it involves re-building the Docker image
- Switch from opt-level='z' to opt-level='s' - this increases the
  binary size by 74416 bytes for the Multi, which is much more than the
  workaround in this commit.
Copy link
Collaborator

@Beerosagos Beerosagos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@benma benma merged commit 89825f4 into BitBoxSwiss:master Jan 22, 2024
1 check passed
@benma benma deleted the compilerbug branch January 22, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants