Skip to content

Commit 9f5539c

Browse files
committed
Fix linker error: undefined symbol core::panicking::panic
Builds with `-Z build-std-features=panic_immediate_abort` to ensure the `core::panicking` plumbing is stripped. See: rust-lang/rust#55011 Adds `-Cpanic=abort` to RUSTFLAGS so that build profiles do not need to specify `panic = "abort"` in Cargo.toml. This can potentially allow simulator builds to customize panics. (Maybe printing to the console and stopping the event loop, for instance. But this work is TBD.) Fixes pd-rs/crankstart#66
1 parent 155da63 commit 9f5539c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ impl Build {
651651
args.push("thumbv7em-none-eabihf");
652652

653653
args.push("-Zbuild-std=core,alloc");
654+
args.push("-Zbuild-std-features=panic_immediate_abort");
654655
}
655656

656657
let envs = if self.device {
@@ -661,6 +662,7 @@ impl Build {
661662
"-Ctarget-cpu=cortex-m7",
662663
"-Clink-args=--emit-relocs",
663664
"-Crelocation-model=pic",
665+
"-Cpanic=abort",
664666
]
665667
.join(" "),
666668
);

0 commit comments

Comments
 (0)