Skip to content

Commit

Permalink
feat?(riscv): align misc options (LTO, opt-level)
Browse files Browse the repository at this point in the history
As with the prior change, the problem we're solving here is shrinking
the state space: there are many branch points within the optmization
machinery, and these settings align with what I've been looking at most
thoroughly.

NB: I have no idea what effect, if any, the Cargo.toml settings have on
downstream crates. Forcing frame pointers in `.cargo/config.toml`
definitely has no effect.
  • Loading branch information
sethp committed May 14, 2023
1 parent 34fc2fb commit 54fc729
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions esp32c3-hal/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
runner = "espflash flash --monitor"
rustflags = [
"-C", "link-arg=-Tlinkall.x",
"-C", "force-frame-pointers",

# comment the cfgs below if you do _not_ wish to emulate atomics.
# enable the atomic codegen option for RISCV
Expand Down
5 changes: 4 additions & 1 deletion esp32c3-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ embassy-time-timg0 = ["esp-hal-common/embassy-time-timg0", "embassy-time/tick-hz
interrupt-preemption = ["esp-hal-common/interrupt-preemption"]

[profile.dev]
opt-level = 1
opt-level = 2
lto = "thin"

[profile.release]
debug = true
opt-level = 2
lto = "thin"

[[example]]
name = "spi_eh1_loopback"
Expand Down

0 comments on commit 54fc729

Please sign in to comment.