summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/zig-0.14-use-baseline-cpu-by-default.patch
diff options
context:
space:
mode:
authorHilton Chain <[email protected]>2024-12-31 21:15:46 +0800
committerHilton Chain <[email protected]>2025-03-05 16:58:41 +0800
commita69a33645183fa3d55d54fe1534a9bb2a33a24a4 (patch)
tree295830d6bac213e9e931cbf1d44d5b214e170f3e /gnu/packages/patches/zig-0.14-use-baseline-cpu-by-default.patch
parent37cb2814bbf64c727a2454e1a55102ba490c312b (diff)
gnu: Add zig-0.14.
* gnu/packages/patches/zig-0.14-fix-runpath.patch: New file. * gnu/packages/patches/zig-0.14-use-baseline-cpu-by-default.patch: New file. * gnu/packages/patches/zig-0.14-use-system-paths.patch: New file. * gnu/local.mk (dist_patch_DATA): Regisiter them. * gnu/packages/zig.scm (zig-0.14-glibc-abi-tool,zig-0.14): New variables. Change-Id: Ibb9e49ee451ca3bac58bd33a50a9f53e0aa31402
Diffstat (limited to 'gnu/packages/patches/zig-0.14-use-baseline-cpu-by-default.patch')
-rw-r--r--gnu/packages/patches/zig-0.14-use-baseline-cpu-by-default.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/gnu/packages/patches/zig-0.14-use-baseline-cpu-by-default.patch b/gnu/packages/patches/zig-0.14-use-baseline-cpu-by-default.patch
new file mode 100644
index 0000000000..c4a6f64540
--- /dev/null
+++ b/gnu/packages/patches/zig-0.14-use-baseline-cpu-by-default.patch
@@ -0,0 +1,36 @@
+From cd20f7d3088d2befb80d7940b587be0197bdc07b Mon Sep 17 00:00:00 2001
+From: Ekaitz Zarraga <[email protected]>
+Date: Sat, 18 Nov 2023 15:04:16 +0100
+Subject: [PATCH] Use `baseline` cpu by default.
+
+This helps Guix tune the package later. Tunning will only add
+`-Dcpu=whatever` which should override the standard behaviour.
+
+Zig by default uses `native`, which interferes with our build process.
+In our previous zig-build-system we chose to add `-Dcpu=baseline` flag
+in each `zig build` execution, but that doesn't allow us to tune the
+package later. Tunning is only designed to add extra flags in the
+command line call, and we already had one set for the baseline case.
+With this patch we set the standard behavior to `baseline` so we don't
+need to add the `-Dcpu=baseline` flag in the zig-build-system and we can
+tune with no issues.
+---
+ lib/std/Target/Query.zig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/std/Target/Query.zig b/lib/std/Target/Query.zig
+index 56387c27b3..1c0f18f93d 100644
+--- a/lib/std/Target/Query.zig
++++ b/lib/std/Target/Query.zig
+@@ -6,7 +6,7 @@
+ /// `null` means native.
+ cpu_arch: ?Target.Cpu.Arch = null,
+
+-cpu_model: CpuModel = .determined_by_arch_os,
++cpu_model: CpuModel = .baseline,
+
+ /// Sparse set of CPU features to add to the set from `cpu_model`.
+ cpu_features_add: Target.Cpu.Feature.Set = .empty,
+--
+2.47.1
+