Path: blob/main/lang/bun/files/patch-scripts_build_zig.ts
49052 views
-- Support explicit CPU target in Zig build.1-- If 'cpu' is defined in the configuration, pass it as the target CPU to Zig,2-- overriding the default baseline/haswell logic on x86_64.34--- scripts/build/zig.ts.orig 2026-05-12 22:12:49 UTC5+++ scripts/build/zig.ts6@@ -188,16 +188,17 @@ export function zigOptimize(cfg: Config): "Debug" | "R7*8* arm64: apple_m1 (darwin), cortex_a76 (windows — no ARMv9 windows yet),9* native (linux — no baseline arm64 builds needed).10- * x64: nehalem (baseline, pre-AVX), haswell (AVX2).11+ * x64: x86_64 (baseline, SSE2), haswell (AVX2).12*/13export function zigCpu(cfg: Config): string {14+ if (cfg.cpu !== undefined) return cfg.cpu;15if (cfg.arm64) {16if (cfg.darwin) return "apple_m1";17if (cfg.windows) return "cortex_a76";18return "native";19}20// x6421- return cfg.baseline ? "nehalem" : "haswell";22+ return cfg.baseline ? "x86_64" : "haswell";23}2425/**262728