Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/lang/bun/files/patch-scripts_build_zig.ts
49052 views
1
-- Support explicit CPU target in Zig build.
2
-- If 'cpu' is defined in the configuration, pass it as the target CPU to Zig,
3
-- overriding the default baseline/haswell logic on x86_64.
4
5
--- scripts/build/zig.ts.orig 2026-05-12 22:12:49 UTC
6
+++ scripts/build/zig.ts
7
@@ -188,16 +188,17 @@ export function zigOptimize(cfg: Config): "Debug" | "R
8
*
9
* arm64: apple_m1 (darwin), cortex_a76 (windows no ARMv9 windows yet),
10
* native (linux no baseline arm64 builds needed).
11
- * x64: nehalem (baseline, pre-AVX), haswell (AVX2).
12
+ * x64: x86_64 (baseline, SSE2), haswell (AVX2).
13
*/
14
export function zigCpu(cfg: Config): string {
15
+ if (cfg.cpu !== undefined) return cfg.cpu;
16
if (cfg.arm64) {
17
if (cfg.darwin) return "apple_m1";
18
if (cfg.windows) return "cortex_a76";
19
return "native";
20
}
21
// x64
22
- return cfg.baseline ? "nehalem" : "haswell";
23
+ return cfg.baseline ? "x86_64" : "haswell";
24
}
25
26
/**
27
28