fix: add ENABLE_BASELINE support for ARM64 to fix crash on older CPUs #26557
+18
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
ENABLE_BASELINEoption for ARM64 architecture (similar to existing x64 baseline support)-moutline-atomicsflag for ARM64 baseline builds to generate runtime-detected atomic implementations-baselinesuffix for ARM64 WebKit downloadsFixes #26556
Problem
Bun 1.3.7 crashes with "Illegal instruction" on older ARM64 CPUs (ARMv8.0-A without LSE support) such as:
The crash occurs because WebKit's
pas_lock.huses GCC atomic builtins that compile to inline LSE instructions (casa, ldaddl, swpa) when built on ARMv8.1+ CI runners. These instructions don't exist on ARMv8.0-A CPUs.Solution
The
-moutline-atomicsflag generates code that performs runtime CPU feature detection and uses the appropriate atomic implementation (LSE on newer CPUs, LL/SC on older CPUs).Note: This fix requires building and publishing baseline ARM64 WebKit builds with
-moutline-atomicsfor the full fix to work. The Bun build system changes here enable downloading those baseline builds once available.Test plan
🤖 Generated with Claude Code