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_deps_zstd.ts
49052 views
1
-- Disable zstd BMI2 runtime-dispatch when building for baseline (v1/SSE2).
2
-- zstd compiles a separate BMI2-optimised Huffman encoder function using
3
-- BMI2_TARGET_ATTRIBUTE (__attribute__((__target__("lzcnt,bmi,bmi2")))).
4
-- This produces shrxq and other BMI2 instructions which are part of
5
-- x86-64-v3, causing the cpu-microarchitecture classifier to report a
6
-- higher-than-v1 required instruction set. Setting DYNAMIC_BMI2=0 prevents
7
-- this variant from being compiled entirely.
8
9
--- scripts/build/deps/zstd.ts.orig 2026-05-23 01:30:45 UTC
10
+++ scripts/build/deps/zstd.ts
11
@@ -65,6 +65,11 @@ export const zstd: Dependency = {
12
defines.ZSTD_DISABLE_ASM = 1;
13
}
14
15
+ // Disable BMI2 runtime-dispatch for baseline (v1/SSE2) builds.
16
+ if (cfg.x64 && cfg.baseline) {
17
+ defines.DYNAMIC_BMI2 = 0;
18
+ }
19
+
20
const spec: DirectBuild = {
21
kind: "direct",
22
sources,
23
24