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_flags.ts
49052 views
1
-- Support explicit CPU target in C++ compiler flags.
2
-- If 'cpu' is defined in the configuration, use -march=${cpu} to target
3
-- the specified microarchitecture, overriding the default baseline/haswell logic.
4
--
5
-- Change x64 baseline from nehalem to x86-64-v1 to ensure maximum compatibility
6
-- on older hardware.
7
--
8
-- Add HWY_COMPILE_ONLY_STATIC define for baseline x64 builds. Google Highway's
9
-- foreach_target.h normally recompiles each translation unit for every supported
10
-- ISA target via #pragma clang attribute push(__attribute__((target(...)))),
11
-- ignoring the -march flag. HWY_COMPILE_ONLY_STATIC restricts this to the static
12
-- target determined by -march (SSE2 with -march=x86-64), preventing AVX/AVX-512
13
-- code from appearing in the binary when CPUTYPE is unset.
14
15
--- scripts/build/flags.ts.orig 2026-05-12 22:12:49 UTC
16
+++ scripts/build/flags.ts
17
@@ -624,6 +624,11 @@ export const defines: Flag[] = [
18
19
// ─── Config-dependent ───
20
{
21
+ flag: "HWY_COMPILE_ONLY_STATIC",
22
+ when: c => c.x64 && c.cpu === undefined && c.baseline,
23
+ desc: "x64 baseline: compile Highway for SSE2 only (matches -march=x86-64)",
24
+ },
25
+ {
26
flag: "ASSERT_ENABLED=1",
27
when: c => c.assertions,
28
desc: "Enable runtime assertions",
29
30