From 9aa158b58bffd0085e51ca53625c85f7d548419c Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Thu, 22 Jan 2026 05:36:07 +0000 Subject: [PATCH] fix: use baseline WebKit builds for CPUs without AVX support The baseline build of Bun is compiled with -march=nehalem (no AVX), but it was downloading a WebKit library compiled with -march=haswell (AVX2). This caused "Illegal instruction" crashes on CPUs without AVX support. Add a -baseline suffix to the WebKit download URL when ENABLE_BASELINE is set on x86_64 builds. This ensures baseline Bun downloads a WebKit built without AVX instructions. Fixes #26353 Co-Authored-By: Claude Opus 4.5 --- cmake/tools/SetupWebKit.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/tools/SetupWebKit.cmake b/cmake/tools/SetupWebKit.cmake index 5464fcff94..ce6eab1bf2 100644 --- a/cmake/tools/SetupWebKit.cmake +++ b/cmake/tools/SetupWebKit.cmake @@ -79,6 +79,12 @@ if(ENABLE_ASAN) set(WEBKIT_SUFFIX "${WEBKIT_SUFFIX}-asan") endif() +# Baseline builds require a WebKit compiled without AVX instructions (nehalem target). +# This only applies to x86_64 builds, as ARM builds don't have this issue. +if(ENABLE_BASELINE AND CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|x64|AMD64") + set(WEBKIT_SUFFIX "${WEBKIT_SUFFIX}-baseline") +endif() + setx(WEBKIT_NAME bun-webkit-${WEBKIT_OS}-${WEBKIT_ARCH}${WEBKIT_SUFFIX}) set(WEBKIT_FILENAME ${WEBKIT_NAME}.tar.gz) setx(WEBKIT_DOWNLOAD_URL https://github.com/oven-sh/WebKit/releases/download/autobuild-${WEBKIT_VERSION}/${WEBKIT_FILENAME})