# zig-20241130-1.patch -rw-r--r-- 20.1 KiB View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
diff --git a/gnu/local.mk b/gnu/local.mk
index 4516ebf25d..f06bd7cba1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2384,6 +2384,9 @@ dist_patch_DATA =						\
   %D%/packages/patches/zig-0.12-use-system-paths.patch		\
   %D%/packages/patches/zig-0.13-build-respect-PKG_CONFIG-env-var.patch	\
   %D%/packages/patches/zig-0.13-fix-runpath.patch		\
+  %D%/packages/patches/zig-0.14-fix-runpath.patch		\
+  %D%/packages/patches/zig-0.14-use-baseline-cpu-by-default.patch	\
+  %D%/packages/patches/zig-0.14-use-system-paths.patch		\
   %D%/packages/patches/zsh-egrep-failing-test.patch		\
   %D%/packages/patches/zuo-bin-sh.patch
 
diff --git a/gnu/packages/patches/zig-0.14-fix-runpath.patch b/gnu/packages/patches/zig-0.14-fix-runpath.patch
new file mode 100644
index 0000000000..324544165e
--- /dev/null
+++ b/gnu/packages/patches/zig-0.14-fix-runpath.patch
@@ -0,0 +1,118 @@
+From d5c31f6d99a3d02c8b0efba13e1a1e82e0e36f96 Mon Sep 17 00:00:00 2001
+From: Hilton Chain <hako@ultrarare.space>
+Date: Fri, 29 Nov 2024 14:13:46 +0800
+Subject: [PATCH] Fix RUNPATH issue.
+
+Add needed libraries and libc to RUNPATH when CROSS_LIBRARY_PATH or LIBRARY_PATH
+is set.
+---
+ lib/std/Build/Step/Compile.zig |  3 +++
+ src/link/Elf.zig               | 14 ++++++++++++++
+ src/main.zig                   | 34 +++++++++++++++++++++++++++++++++-
+ 3 files changed, 50 insertions(+), 1 deletion(-)
+
+diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig
+index 1dd444abf2..df7f4a56db 100644
+--- a/lib/std/Build/Step/Compile.zig
++++ b/lib/std/Build/Step/Compile.zig
+@@ -778,6 +778,9 @@ fn runPkgConfig(compile: *Compile, lib_name: []const u8) !PkgConfigResult {
+             try zig_cflags.appendSlice(&[_][]const u8{ "-D", macro });
+         } else if (mem.startsWith(u8, arg, "-D")) {
+             try zig_cflags.append(arg);
++        } else if (mem.startsWith(u8, arg, "-Wl,-rpath=")) {
++            const dir = arg["-Wl,-rpath=".len..];
++            try zig_libs.appendSlice(&[_][]const u8{ "-L", dir });
+         } else if (b.debug_pkg_config) {
+             return compile.step.fail("unknown pkg-config flag '{s}'", .{arg});
+         }
+diff --git a/src/link/Elf.zig b/src/link/Elf.zig
+index 608ff2fe3a..2b9fe803fd 100644
+--- a/src/link/Elf.zig
++++ b/src/link/Elf.zig
+@@ -1037,6 +1037,13 @@ fn dumpArgvInit(self: *Elf, arena: Allocator) !void {
+             try argv.appendSlice(gpa, &.{ "-rpath", rpath });
+         }
+ 
++        if (std.zig.system.NativePaths.isGuix(arena) and comp.config.link_libc and comp.config.link_mode == .dynamic) {
++            if (self.base.comp.libc_installation) |libc_installation| {
++                try argv.append(gpa, "-rpath");
++                try argv.append(gpa, libc_installation.crt_dir.?);
++            }
++        }
++
+         try argv.appendSlice(gpa, &.{
+             "-z",
+             try std.fmt.allocPrint(arena, "stack-size={d}", .{self.base.stack_size}),
+@@ -1857,6 +1864,13 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s
+             try argv.appendSlice(&.{ "-rpath", rpath });
+         }
+ 
++        if (std.zig.system.NativePaths.isGuix(arena) and comp.config.link_libc and link_mode == .dynamic) {
++            if (self.base.comp.libc_installation) |libc_installation| {
++                try argv.append("-rpath");
++                try argv.append(libc_installation.crt_dir.?);
++            }
++        }
++
+         for (self.symbol_wrap_set.keys()) |symbol_name| {
+             try argv.appendSlice(&.{ "-wrap", symbol_name });
+         }
+diff --git a/src/main.zig b/src/main.zig
+index 79493aa624..505bb7570a 100644
+--- a/src/main.zig
++++ b/src/main.zig
+@@ -3901,7 +3901,7 @@ fn createModule(
+                 create_module.want_native_include_dirs = true;
+         }
+ 
+-        if (create_module.each_lib_rpath orelse resolved_target.is_native_os) {
++        if (create_module.each_lib_rpath orelse false) {
+             try create_module.rpath_list.ensureUnusedCapacity(arena, create_module.lib_directories.items.len);
+             for (create_module.lib_directories.items) |lib_directory| {
+                 create_module.rpath_list.appendAssumeCapacity(lib_directory.path.?);
+@@ -3976,6 +3976,28 @@ fn createModule(
+             else => {},
+         };
+ 
++        if (std.zig.system.NativePaths.isGuix(arena)) {
++            for (create_module.link_inputs.items) |link_input| {
++                if (link_input.path()) |lib| {
++                    const lib_name = lib.sub_path;
++                    if (Compilation.classifyFileExt(lib_name) == .shared_library) {
++                        if (fs.path.isAbsolute(lib_name)) {
++                            const lib_dir_path = fs.path.dirname(lib_name).?;
++                            try create_module.rpath_list.append(arena, lib_dir_path);
++                            continue;
++                        }
++                        for (create_module.lib_directories.items) |lib_dir| {
++                            const lib_dir_path = lib_dir.path.?;
++                            if (try libPathExists(arena, lib_dir_path, lib_name)) {
++                                try create_module.rpath_list.append(arena, lib_dir_path);
++                                break;
++                            }
++                        }
++                    }
++                }
++            }
++        }
++
+         create_module.resolved_options = Compilation.Config.resolve(create_module.opts) catch |err| switch (err) {
+             error.WasiExecModelRequiresWasi => fatal("only WASI OS targets support execution model", .{}),
+             error.SharedMemoryIsWasmOnly => fatal("only WebAssembly CPU targets support shared memory", .{}),
+@@ -7495,3 +7517,13 @@ fn addLibDirectoryWarn2(
+         .path = path,
+     });
+ }
++
++fn libPathExists(arena: Allocator, lib_dir_path: []const u8, lib_name: []const u8) !bool {
++    const lib_path = try std.fmt.allocPrint(arena, "{s}{s}{s}", .{
++        lib_dir_path,
++        fs.path.sep_str,
++        lib_name,
++    });
++    fs.cwd().access(lib_path, .{}) catch return false;
++    return true;
++}
+-- 
+2.46.0
+
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..ccbf2fcb47
--- /dev/null
+++ b/gnu/packages/patches/zig-0.14-use-baseline-cpu-by-default.patch
@@ -0,0 +1,36 @@
+From 7da6d5e31e3f99fef7e669e2dbe4104ae0f12073 Mon Sep 17 00:00:00 2001
+From: Ekaitz Zarraga <ekaitz@elenq.tech>
+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 144b2d60af..5a496b531d 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 = CpuModel.determined_by_arch_os,
++cpu_model: CpuModel = CpuModel.baseline,
+ 
+ /// Sparse set of CPU features to add to the set from `cpu_model`.
+ cpu_features_add: Target.Cpu.Feature.Set = Target.Cpu.Feature.Set.empty,
+-- 
+2.46.0
+
diff --git a/gnu/packages/patches/zig-0.14-use-system-paths.patch b/gnu/packages/patches/zig-0.14-use-system-paths.patch
new file mode 100644
index 0000000000..5ece0c0cdd
--- /dev/null
+++ b/gnu/packages/patches/zig-0.14-use-system-paths.patch
@@ -0,0 +1,133 @@
+From 813993ef425ba24e7a18d3cdf700c0589a333943 Mon Sep 17 00:00:00 2001
+From: Hilton Chain <hako@ultrarare.space>
+Date: Fri, 29 Nov 2024 14:13:30 +0800
+Subject: [PATCH] Use system paths.
+
+Prefer Guix search paths and support Guix cross builds.
+---
+ lib/std/zig/system.zig             | 25 +++++++++++---
+ lib/std/zig/system/NativePaths.zig | 53 ++++++++++++++++++++++++++++++
+ src/main.zig                       |  3 +-
+ 3 files changed, 76 insertions(+), 5 deletions(-)
+
+diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig
+index 48b195dc3e..b636c46656 100644
+--- a/lib/std/zig/system.zig
++++ b/lib/std/zig/system.zig
+@@ -1176,10 +1176,27 @@ fn defaultAbiAndDynamicLinker(cpu: Target.Cpu, os: Target.Os, query: Target.Quer
+         .os = os,
+         .abi = abi,
+         .ofmt = query.ofmt orelse Target.ObjectFormat.default(os.tag, cpu.arch),
+-        .dynamic_linker = if (query.dynamic_linker.get() == null)
+-            Target.DynamicLinker.standard(cpu, os, abi)
+-        else
+-            query.dynamic_linker,
++        .dynamic_linker = if (query.dynamic_linker.get() == null) blk: {
++            var standard_linker = Target.DynamicLinker.standard(cpu, os, abi);
++            if (standard_linker.get()) |standard_linker_path| {
++                if (builtin.os.tag != .windows and builtin.os.tag != .wasi) {
++                    if (posix.getenv("CROSS_LIBRARY_PATH") orelse posix.getenv("LIBRARY_PATH")) |library_path| {
++                        const linker_basename = fs.path.basename(standard_linker_path);
++                        var buffer: [255]u8 = undefined;
++                        var it = mem.tokenizeScalar(u8, library_path, ':');
++                        while (it.next()) |dir| {
++                            const linker_fullpath = std.fmt.bufPrint(&buffer, "{s}{s}{s}", .{ dir, fs.path.sep_str, linker_basename }) catch "";
++                            const guix_linker_path = fs.cwd().realpath(linker_fullpath, &buffer) catch "";
++                            if (guix_linker_path.len != 0) {
++                                standard_linker.set(guix_linker_path);
++                                break;
++                            }
++                        }
++                    }
++                }
++            }
++            break :blk standard_linker;
++        } else query.dynamic_linker,
+     };
+ }
+ 
+diff --git a/lib/std/zig/system/NativePaths.zig b/lib/std/zig/system/NativePaths.zig
+index 3c96134556..90f31b17c1 100644
+--- a/lib/std/zig/system/NativePaths.zig
++++ b/lib/std/zig/system/NativePaths.zig
+@@ -15,6 +15,51 @@ warnings: std.ArrayListUnmanaged([]const u8) = .empty,
+ 
+ pub fn detect(arena: Allocator, native_target: std.Target) !NativePaths {
+     var self: NativePaths = .{ .arena = arena };
++    if (isGuix(arena)) {
++        inline for ([_][]const u8{ "CROSS_C_INCLUDE_PATH", "CROSS_CPLUS_INCLUDE_PATH" }) |env_var| {
++            if (process.getEnvVarOwned(arena, env_var)) |include_path| {
++                var it = mem.tokenizeScalar(u8, include_path, ':');
++                while (it.next()) |dir|
++                    try self.addIncludeDir(dir);
++            } else |err| switch (err) {
++                error.InvalidWtf8 => unreachable,
++                error.EnvironmentVariableNotFound => {},
++                error.OutOfMemory => |e| return e,
++            }
++        }
++        if (process.getEnvVarOwned(arena, "CROSS_LIBRARY_PATH")) |library_path| {
++            var it = mem.tokenizeScalar(u8, library_path, ':');
++            while (it.next()) |dir|
++                try self.addLibDir(dir);
++        } else |err| switch (err) {
++            error.InvalidWtf8 => unreachable,
++            error.EnvironmentVariableNotFound => {},
++            error.OutOfMemory => |e| return e,
++        }
++        if (!isCrossGuix(arena)) {
++            inline for ([_][]const u8{ "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH" }) |env_var| {
++                if (process.getEnvVarOwned(arena, env_var)) |include_path| {
++                    var it = mem.tokenizeScalar(u8, include_path, ':');
++                    while (it.next()) |dir|
++                        try self.addIncludeDir(dir);
++                } else |err| switch (err) {
++                    error.InvalidWtf8 => unreachable,
++                    error.EnvironmentVariableNotFound => {},
++                    error.OutOfMemory => |e| return e,
++                }
++            }
++            if (process.getEnvVarOwned(arena, "LIBRARY_PATH")) |library_path| {
++                var it = mem.tokenizeScalar(u8, library_path, ':');
++                while (it.next()) |dir|
++                    try self.addLibDir(dir);
++            } else |err| switch (err) {
++                error.InvalidWtf8 => unreachable,
++                error.EnvironmentVariableNotFound => {},
++                error.OutOfMemory => |e| return e,
++            }
++        }
++        return self;
++    }
+     var is_nix = false;
+     if (process.getEnvVarOwned(arena, "NIX_CFLAGS_COMPILE")) |nix_cflags_compile| {
+         is_nix = true;
+@@ -208,3 +253,11 @@ pub fn addWarningFmt(self: *NativePaths, comptime fmt: []const u8, args: anytype
+ pub fn addRPath(self: *NativePaths, s: []const u8) !void {
+     try self.rpaths.append(self.arena, s);
+ }
++
++pub fn isCrossGuix(arena: Allocator) bool {
++    return process.hasEnvVar(arena, "CROSS_LIBRARY_PATH") catch false;
++}
++
++pub fn isGuix(arena: Allocator) bool {
++    return isCrossGuix(arena) or process.hasEnvVar(arena, "LIBRARY_PATH") catch false;
++}
+diff --git a/src/main.zig b/src/main.zig
+index 0d239f1f99..79493aa624 100644
+--- a/src/main.zig
++++ b/src/main.zig
+@@ -3909,7 +3909,8 @@ fn createModule(
+         }
+ 
+         // Trigger native system library path detection if necessary.
+-        if (create_module.sysroot == null and
++        if (std.zig.system.NativePaths.isCrossGuix(arena) or
++            create_module.sysroot == null and
+             resolved_target.is_native_os and resolved_target.is_native_abi and
+             create_module.want_native_include_dirs)
+         {
+-- 
+2.46.0
+
diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
index d5ae5ff789..409836ee87 100644
--- a/gnu/packages/zig.scm
+++ b/gnu/packages/zig.scm
@@ -1578,4 +1578,171 @@ (define-public zig-0.13
     (properties `((max-silent-time . 9600)
                   ,@(clang-compiler-cpu-architectures "18")))))
 
+
+;;;
+;;; Bootstrap path for Zig 0.14.
+;;;
+
+(define zig-0.13.0-286
+  (let ((commit "d72a8db2db1a5c77af2deb713248dc53f9adcb73")
+        (revision "286")
+        (base zig-0.13))
+    (package
+      (inherit base)
+      (name "zig")
+      (version (git-version "0.13.0" revision commit))
+      (source (zig-source
+               version commit
+               "1rnpv4lwc2jxz5yymrb4hlfy4iii48bn94rjpr3vll8yyydinpnb"))
+      ;; zig2
+      (arguments (package-arguments zig-0.10.0-851))
+      (native-inputs
+       (modify-inputs (package-native-inputs base)
+         (replace "zig" `(,base "zig1")))))))
+
+(define zig-0.13.0-503
+  (let ((commit "25198810c88d474c63ff537e3647f12e7df6297c")
+        (revision "503")
+        (base zig-0.13.0-286))
+    (package
+      (inherit base)
+      (name "zig")
+      (version (git-version "0.13.0" revision commit))
+      (source (zig-source
+               version commit
+               "1i2baqav7qxv7ll94win6xfsm45dpzrwkwpayzrdll1aq9k4ywvb"))
+      ;; zig1
+      (arguments (package-arguments zig-0.10.0-747))
+      (native-inputs
+       (modify-inputs (package-native-inputs base)
+         (replace "zig" `(,base "out")))))))
+
+(define zig-0.13.0-1323
+  (let ((commit "457c94d353b77b08786aa8794e1afc6a62d5c34a")
+        (revision "1323")
+        (base zig-0.13.0-503))
+    (package
+      (inherit base)
+      (name "zig")
+      (version (git-version "0.13.0" revision commit))
+      (source (zig-source
+               version commit
+               "1kh4iy7mk86s7fpqgrp5i2m1a3d8vhz5plmhkglzykdr3calqqhi"))
+      ;; zig2
+      (arguments (package-arguments zig-0.10.0-851))
+      (native-inputs
+       (modify-inputs (package-native-inputs base)
+         (replace "zig" `(,base "zig1")))))))
+
+(define zig-0.13.0-1528
+  (let ((commit "8ec68c63fa1d0f7e267ff92c054e8aa335f91da4")
+        (revision "1528")
+        (base zig-0.13.0-1323))
+    (package
+      (inherit base)
+      (name "zig")
+      (version (git-version "0.13.0" revision commit))
+      (source (zig-source
+               version commit
+               "1a7q20wbadjqj0xmajq6f3kk9mlkz9wqgvw4zm62r5bn1xzcs5kd"))
+      ;; zig1
+      (arguments (package-arguments zig-0.10.0-747))
+      (native-inputs
+       (modify-inputs (package-native-inputs base)
+         (replace "zig" `(,base "out")))))))
+
+(define zig-0.13.0-1951
+  (let ((commit "8573836892ba1b7cd34d377b46258930161256c3")
+        (revision "1951")
+        (base zig-0.13.0-1528))
+    (package
+      (inherit base)
+      (name "zig")
+      (version (git-version "0.13.0" revision commit))
+      (source (zig-source
+               version commit
+               "094yxy3db6sjvcni4jl1d6nf46hlarhw6hnxhcw7vwq4qaj9w9xq"))
+      ;; zig2
+      (arguments
+       (substitute-keyword-arguments (package-arguments zig-0.10.0-851)
+         ((#:phases phases '%standard-phases)
+          #~(modify-phases #$phases
+              ;; See also upstream commit
+              ;; f1f804e532e603a3f58d559d32a1c8120691d891.
+              (add-after 'unpack 'fix-compilation
+                (lambda _
+                  (substitute* "src/zig_llvm.cpp"
+                    ((".*LastEnvironmentType.*") ""))))))))
+      (inputs
+       (modify-inputs (package-inputs base)
+         (replace "clang" clang-19)
+         (replace "lld" lld-19)))
+      (native-inputs
+       (modify-inputs (package-native-inputs base)
+         (replace "llvm" llvm-19)
+         (replace "zig" `(,base "zig1"))))
+      (properties `((max-silent-time . 9600)
+                    ,@(clang-compiler-cpu-architectures "19"))))))
+
+(define zig-0.13.0-1952
+  (let ((commit "51706af908e0c6acb822ef36760b7fe31faf62a6")
+        (revision "1952")
+        (base zig-0.13.0-1951))
+    (package
+      (inherit base)
+      (name "zig")
+      (version (git-version "0.13.0" revision commit))
+      (source (zig-source
+               version commit
+               "1ypwd8is0zmnq042qzya34jks1sfkk1grdi1asymbqnmp0c3p4m7"))
+      ;; zig1
+      (arguments (package-arguments zig-0.10.0-747))
+      (native-inputs
+       (modify-inputs (package-native-inputs base)
+         (replace "zig" `(,base "out")))))))
+
+(define zig-0.14-glibc-abi-tool
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://github.com/ziglang/glibc-abi-tool")
+          (commit "23fa2936e21ef8573d0a7c244523284fc3a17567")))
+    (file-name "zig-0.14-glibc-abi-tool-checkout")
+    (sha256
+     (base32 "18s08rqv457fs9jaiqf3smlkqbmpsan2rl0w6p3d59j0v1jf9cvq"))
+    (modules '((guix build utils)))
+    (snippet
+     #~(substitute* "consolidate.zig"
+         (("(const new_inc = ).*" _ prefix)
+          (string-append prefix "Inclusion {"))))))
+
+(define zig-0.14
+  (let ((commit "aa7d138462602e086aacf738e4b92bfa3372bebe")
+        (revision "2367"))
+    (package
+      (inherit zig-0.13)
+      (name "zig")
+      (version (git-version "0.13.0" revision commit))
+      (source
+       (origin
+         (inherit (zig-source
+                   version commit
+                   "17z55qk1hp6ghap9mkblsbm0ivda5niy3cwxcyrbkwr3xhmc7qvz"))
+         (patches
+          (search-patches
+           "zig-0.14-use-baseline-cpu-by-default.patch"
+           "zig-0.14-use-system-paths.patch"
+           "zig-0.14-fix-runpath.patch"))))
+      (inputs
+       (modify-inputs (package-inputs zig-0.13)
+         (replace "clang" clang-19)
+         (replace "lld" lld-19)))
+      (native-inputs
+       (modify-inputs (package-native-inputs zig-0.13)
+         (replace "glibc-abi-tool" zig-0.14-glibc-abi-tool)
+         (replace "llvm" llvm-19)
+         (replace "zig" `(,zig-0.13.0-1952 "zig1"))))
+      (properties `((max-silent-time . 9600)
+                    ,@(clang-compiler-cpu-architectures "19"))))))
+
 (define-public zig zig-0.13)