Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7315-auto-optimize-unwind-tables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- fix(compile): auto-optimize no longer strips the runtime's unwind tables. Setting `RUSTFLAGS` for the rebuild replaced `.cargo/config.toml`'s `[build] rustflags`, the only place `-C force-unwind-tables=yes` lives, so any auto-optimized binary aborted on the first `throw` crossing a runtime frame. The flag is now appended explicitly, except under `panic_immediate` which deliberately wants the tables gone. (#7315)
7 changes: 7 additions & 0 deletions crates/perry/src/commands/compile/optimized_libs/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,13 @@ pub(crate) fn build_optimized_libs(
// RUSTFLAGS from the parent environment, which is exactly the isolation a
// pinned-baseline build needs.
if !rustflags.is_empty() || requested_cpu.is_some() {
// #7315: setting RUSTFLAGS here replaces `.cargo/config.toml`'s
// `[build] rustflags`, which is where `-C force-unwind-tables=yes`
// lives. Without it the rebuilt runtime has no unwind tables and the
// first `throw` that crosses a runtime frame aborts.
if !panic_immediate {
rustflags.push("-C force-unwind-tables=yes".to_string());
}
cargo_cmd.env("RUSTFLAGS", rustflags.join(" "));
}

Expand Down
Loading