Add baseline x64 Linux builds for CPUs without AVX#137
Conversation
This adds baseline builds (`-march=nehalem`) for x86_64 Linux to support CPUs that have SSE4.2 but lack AVX instructions. Changes: - Add MARCH_FLAG build argument to Dockerfile for custom -march flags - Update release.sh to pass MARCH_FLAG to Docker buildx - Add baseline matrix entries in build-reusable.yml: - bun-webkit-linux-amd64-baseline (non-LTO) - bun-webkit-linux-amd64-baseline-lto (LTO) - Update release job to download and publish baseline artifacts This fixes the "Illegal instruction" crash when running baseline Bun builds on CPUs without AVX support (oven-sh/bun#26071). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This adds baseline musl builds (`-march=nehalem`) for x86_64 Alpine Linux to support CPUs that have SSE4.2 but lack AVX instructions. Changes: - Add MARCH_FLAG support to Dockerfile.musl (ICU and WebKit builds) - Update musl-release.sh to pass MARCH_FLAG to Docker buildx - Add baseline musl matrix entries in build-reusable.yml: - bun-webkit-linux-amd64-musl-baseline (non-LTO) - bun-webkit-linux-amd64-musl-baseline-lto (LTO) - Update release job to download and publish baseline musl artifacts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/build |
WalkthroughAdds CPU baseline build variants targeting nehalem-era processors without AVX support to the build matrix. Introduces architecture-specific compilation flag (MARCH_FLAG) throughout build pipeline, enabling support for older CPUs and addressing compatibility with systems lacking AVX instructions. Changes
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (5)
🔇 Additional comments (11)
✏️ Tip: You can disable this entire section by setting Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
|
/build-preview |
1 similar comment
|
/build-preview |
|
🔄 Preview build started Release tag: |
|
This may have been caused by a newer build being triggered for the same PR. |
|
🔄 Preview build started Release tag: |
|
✅ Preview build completed Release: autobuild-preview-pr-137-8ea86667 |
When ENABLE_BASELINE=ON is set for x86_64 builds, append `-baseline` to the WebKit download URL suffix. Without this, baseline Bun links against a WebKit library compiled with AVX/AVX2 instructions, causing SIGILL crashes on CPUs without AVX support. The baseline suffix is placed after the musl suffix and before the debug/lto/asan suffixes to match the naming convention used by the WebKit CI (oven-sh/WebKit#137). Closes #27090 Co-Authored-By: Claude <noreply@anthropic.com>
Linux x64 was pinned to -march=nehalem for all builds in 596e48e. This splits that: default entries get -march=haswell (matching bun's non-baseline target), new -baseline entries keep -march=nehalem. Windows had no arch pin at all. Both WebKit (clang-cl) and ICU (MSVC cl.exe via MSBuild) compiled without -march / /arch:, letting the auto-vectorizer emit AVX2/AVX-512 in ICU's hash and decimal loops with no CPUID gate. Now windows-release.ps1 takes -Baseline and threads /clang:-march= into CMake flags; build-icu.ps1 injects /arch: into the .vcxproj patches (/arch:SSE2 for baseline, /arch:AVX2 otherwise). New artifacts: bun-webkit-linux-amd64-baseline{,-lto} bun-webkit-linux-amd64-musl-baseline{,-lto} bun-webkit-windows-amd64-baseline Supersedes #137.
* Add x64 baseline WebKit builds for Linux and Windows Linux x64 was pinned to -march=nehalem for all builds in 596e48e. This splits that: default entries get -march=haswell (matching bun's non-baseline target), new -baseline entries keep -march=nehalem. Windows had no arch pin at all. Both WebKit (clang-cl) and ICU (MSVC cl.exe via MSBuild) compiled without -march / /arch:, letting the auto-vectorizer emit AVX2/AVX-512 in ICU's hash and decimal loops with no CPUID gate. Now windows-release.ps1 takes -Baseline and threads /clang:-march= into CMake flags; build-icu.ps1 injects /arch: into the .vcxproj patches (/arch:SSE2 for baseline, /arch:AVX2 otherwise). New artifacts: bun-webkit-linux-amd64-baseline{,-lto} bun-webkit-linux-amd64-musl-baseline{,-lto} bun-webkit-windows-amd64-baseline Supersedes #137. * mac-release: pin clang++ to clang++-21 The C compiler was pinned (clang-21) but the C++ compiler was unqualified clang++. GH Actions macOS runner image changed between Feb 24 and Mar 3 so clang++ now resolves to Apple Clang instead of homebrew LLVM 21. Apple Clang's libc++ doesn't define _LIBCPP_AVAILABILITY_HAS_HASH_MEMORY, so LibcxxHashMemoryShim.cpp compiles to an empty object (__TEXT=0). Bun then fails to link with undefined std::__1::__hash_memory.
Summary
-march=nehalem) for x86_64 Linux to support CPUs that have SSE4.2 but lack AVX instructionsChanges
MARCH_FLAGto both ICU and WebKit compiler flagsMARCH_FLAGbuild argument to Docker buildxcpu: nehalemandMARCH_FLAG: "-march=nehalem"New Artifacts
bun-webkit-linux-amd64-baseline(non-LTO)bun-webkit-linux-amd64-baseline-lto(LTO)Related Issue
This is required to fix oven-sh/bun#26071 - baseline Bun builds crash with "Illegal instruction" on CPUs without AVX because the prebuilt WebKit is compiled with
-march=haswell(AVX2) while baseline Bun is compiled with-march=nehalem(SSE4.2).Test plan
🤖 Generated with Claude Code