mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Fix aarch64 SIGILL: disable mimalloc LSE atomics + update WebKit + QEMU verification (#26586)
Fixes illegal instruction (SIGILL) crashes on ARMv8.0 aarch64 CPUs (Cortex-A53, Raspberry Pi 4, AWS a1 instances). ## Root cause Upstream mimalloc force-enables `MI_OPT_ARCH` on arm64, which adds `-march=armv8.1-a` and emits LSE atomic instructions (`casa`, `swpa`, `ldaddl`). These are not available on ARMv8.0 CPUs. ## Fix - Pass `MI_NO_OPT_ARCH=ON` to mimalloc on aarch64 (has priority over `MI_OPT_ARCH` in mimalloc's CMake) - Update WebKit to autobuild-596e48e22e3a1090e5b802744a7938088b1ea860 which explicitly passes `-march` flags to the WebKit build ## Verification Includes QEMU-based baseline CPU verification CI steps (#26571) that catch these regressions automatically.
This commit is contained in:
@@ -69,8 +69,18 @@ if(ENABLE_VALGRIND)
|
|||||||
list(APPEND MIMALLOC_CMAKE_ARGS -DMI_VALGRIND=ON)
|
list(APPEND MIMALLOC_CMAKE_ARGS -DMI_VALGRIND=ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Enable SIMD optimizations when not building for baseline (older CPUs)
|
# Enable architecture-specific optimizations when not building for baseline.
|
||||||
if(NOT ENABLE_BASELINE)
|
# On Linux aarch64, upstream mimalloc force-enables MI_OPT_ARCH which adds
|
||||||
|
# -march=armv8.1-a (LSE atomics). This crashes on ARMv8.0 CPUs
|
||||||
|
# (Cortex-A53, Raspberry Pi 4, AWS a1 instances). Use MI_NO_OPT_ARCH
|
||||||
|
# to prevent that, but keep SIMD enabled. -moutline-atomics for runtime
|
||||||
|
# dispatch to LSE/LL-SC. macOS arm64 always has LSE (Apple Silicon) so
|
||||||
|
# MI_OPT_ARCH is safe there.
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|ARM64|AARCH64" AND NOT APPLE)
|
||||||
|
list(APPEND MIMALLOC_CMAKE_ARGS -DMI_NO_OPT_ARCH=ON)
|
||||||
|
list(APPEND MIMALLOC_CMAKE_ARGS -DMI_OPT_SIMD=ON)
|
||||||
|
list(APPEND MIMALLOC_CMAKE_ARGS "-DCMAKE_C_FLAGS=-moutline-atomics")
|
||||||
|
elseif(NOT ENABLE_BASELINE)
|
||||||
list(APPEND MIMALLOC_CMAKE_ARGS -DMI_OPT_ARCH=ON)
|
list(APPEND MIMALLOC_CMAKE_ARGS -DMI_OPT_ARCH=ON)
|
||||||
list(APPEND MIMALLOC_CMAKE_ARGS -DMI_OPT_SIMD=ON)
|
list(APPEND MIMALLOC_CMAKE_ARGS -DMI_OPT_SIMD=ON)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ option(WEBKIT_VERSION "The version of WebKit to use")
|
|||||||
option(WEBKIT_LOCAL "If a local version of WebKit should be used instead of downloading")
|
option(WEBKIT_LOCAL "If a local version of WebKit should be used instead of downloading")
|
||||||
|
|
||||||
if(NOT WEBKIT_VERSION)
|
if(NOT WEBKIT_VERSION)
|
||||||
set(WEBKIT_VERSION 9a2cc42ae1bf693a0fd0ceb9b1d7d965d9cfd3ea)
|
set(WEBKIT_VERSION 515344bc5d65aa2d4f9ff277b5fb944f0e051dcd)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Use preview build URL for Windows ARM64 until the fix is merged to main
|
# Use preview build URL for Windows ARM64 until the fix is merged to main
|
||||||
|
|||||||
Reference in New Issue
Block a user