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 <noreply@anthropic.com>
This commit is contained in:
Claude Bot
2026-01-22 05:36:07 +00:00
parent 7f70b01259
commit 9aa158b58b

View File

@@ -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})