Skip to content

Commit 54fc729

Browse files
committed
feat?(riscv): align misc options (LTO, opt-level)
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.
1 parent 34fc2fb commit 54fc729

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

esp32c3-hal/.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
runner = "espflash flash --monitor"
33
rustflags = [
44
"-C", "link-arg=-Tlinkall.x",
5+
"-C", "force-frame-pointers",
56

67
# comment the cfgs below if you do _not_ wish to emulate atomics.
78
# enable the atomic codegen option for RISCV

esp32c3-hal/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ embassy-time-timg0 = ["esp-hal-common/embassy-time-timg0", "embassy-time/tick-hz
6565
interrupt-preemption = ["esp-hal-common/interrupt-preemption"]
6666

6767
[profile.dev]
68-
opt-level = 1
68+
opt-level = 2
69+
lto = "thin"
6970

7071
[profile.release]
7172
debug = true
73+
opt-level = 2
74+
lto = "thin"
7275

7376
[[example]]
7477
name = "spi_eh1_loopback"

0 commit comments

Comments
 (0)