Skip to content

Drop unwind tables from Linux and macOS release workers - #19

Open
bgw wants to merge 1 commit into
mainfrom
bgw/no-unwind-tables
Open

bgw wants to merge 1 commit into
mainfrom
bgw/no-unwind-tables

Conversation

@bgw

@bgw bgw commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Workers abort on panic, and their symbols are stripped, so their unwind
tables (.eh_frame) can't be used for unwinding or useful backtraces.
scripts/build-native.mjs now disables them on Linux, for Rust
(-C force-unwind-tables=no) and for libwebp and mozjpeg
(CFLAGS_<target>). On aarch64-unknown-linux-gnu, the worker shrinks
from 5,389,384 to 5,258,312 bytes (-128 KiB, -2.4%), or from 5,324,984
to 5,232,944 bytes (-90 KiB, -1.7%) without the padding between its
64 KiB-aligned segments. std is prebuilt, so its tables (about
150 KiB) stay.

Windows requires unwind tables, and macOS isn't measured, so they're
unchanged.

pnpm build:release now runs the same script for the host, so that
pnpm test:release and the benchmark use CI's flags. The script always
passes --target, so that the flags don't apply to build scripts and
proc macros, and copies the worker to target/release.

Co-Authored-By: Claude noreply@anthropic.com

Stack created with GitHub Stacks CLI • Give Feedback 💬

@bgw
bgw added this pull request to stack #21 November 19, 2026 17:04
@bgw
bgw removed this pull request from stack #21 November 20, 2026 00:05
@bgw
bgw force-pushed the bgw/no-unwind-tables branch from 68a485a to eda153c Compare November 20, 2026 00:05
@bgw
bgw changed the base branch from bgw/resize-typed-image to main November 20, 2026 00:05
@bgw
bgw added this pull request to stack #23 November 20, 2026 00:05
Workers abort on panic, and their symbols are stripped, so their unwind
tables (`.eh_frame`) can't be used for unwinding or useful backtraces.
Release builds now disable them on Linux and macOS, for Rust
(`-C force-unwind-tables=no`) and for libwebp and mozjpeg
(`CFLAGS_<target>`). On aarch64-unknown-linux-gnu, the worker shrinks
from 5,389,384 to 5,258,312 bytes (-128 KiB, -2.4%), or from 5,324,984
to 5,232,944 bytes (-90 KiB, -1.7%) without the padding between its
64 KiB-aligned segments. std is prebuilt, so its tables (about
150 KiB) stay. On macOS, rustc already omits them with
`panic = "abort"`, so only the C libraries change (not measured).
Windows requires unwind tables, and wasm doesn't have them.

The flags are in `.cargo/worker-release.toml`, which
`scripts/build-native.mjs` (CI) and `pnpm build:release` pass with
`--config`. They aren't in `.cargo/config.toml`, because tests unwind.
`[env]` can't be conditional on the target
(rust-lang/cargo#10273), so it lists a
`CFLAGS_<target>` for every Linux and macOS target in
`scripts/platforms.mjs`. `pnpm build:release` doesn't pass `--target`,
so there the flags also apply to build scripts and proc macros, which
only changes how they fail if they panic.

rav1d's `RUSTC_BOOTSTRAP=rav1d` (for riscv) moves from the script to
`.cargo/config.toml`'s `[env]`, so that any riscv build works.

Co-Authored-By: Claude <noreply@anthropic.com>
@bgw
bgw force-pushed the bgw/no-unwind-tables branch from eda153c to 442a52e Compare November 20, 2026 02:53
@bgw
bgw marked this pull request as ready for review November 20, 2026 03:03
@bgw
bgw requested a review from a team November 20, 2026 03:03
@bgw bgw changed the title Drop unwind tables from Linux release workers Drop unwind tables from Linux and macOS release workers Nov 20, 2026

This branch has not been deployed

No deployments
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.

1 participant