diff options
| author | Hilton Chain <hako@ultrarare.space> | 2025-05-24 08:28:33 +0800 |
|---|---|---|
| committer | Hilton Chain <hako@ultrarare.space> | 2025-05-24 08:57:13 +0800 |
| commit | 8b809c331173388dcb6c0e88178d6cc76a1da3b1 (patch) | |
| tree | ffe63f8635429867bd328c28b6faca6f610e181c /gnu/packages | |
| parent | ce267b3765ef1a6177971aa0042deaeec750ea97 (diff) | |
gnu: zig: Update to 0.14.1.
* gnu/packages/patches/zig-0.14-fix-runpath.patch: Update patch.
* gnu/packages/zig.scm (zig-0.14): Update to 0.14.1.
Change-Id: I8e3dc0b0817b50d10dde56639aa5e1c715e525c7
Diffstat (limited to 'gnu/packages')
| -rw-r--r-- | gnu/packages/patches/zig-0.14-fix-runpath.patch | 39 | ||||
| -rw-r--r-- | gnu/packages/zig.scm | 4 |
2 files changed, 14 insertions, 29 deletions
diff --git a/gnu/packages/patches/zig-0.14-fix-runpath.patch b/gnu/packages/patches/zig-0.14-fix-runpath.patch index 324544165e3..3bfe6371915 100644 --- a/gnu/packages/patches/zig-0.14-fix-runpath.patch +++ b/gnu/packages/patches/zig-0.14-fix-runpath.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From d5c31f6d99a3d02c8b0efba13e1a1e82e0e36f96 Mon Sep 17 00:00:00 2001 | 1 | From 467261b7e31dbb56aa06318bdd2e7260a80b313a Mon Sep 17 00:00:00 2001 |
| 2 | From: Hilton Chain <hako@ultrarare.space> | 2 | From: Hilton Chain <hako@ultrarare.space> |
| 3 | Date: Fri, 29 Nov 2024 14:13:46 +0800 | 3 | Date: Fri, 29 Nov 2024 14:13:46 +0800 |
| 4 | Subject: [PATCH] Fix RUNPATH issue. | 4 | Subject: [PATCH] Fix RUNPATH issue. |
| @@ -6,30 +6,15 @@ Subject: [PATCH] Fix RUNPATH issue. | |||
| 6 | Add needed libraries and libc to RUNPATH when CROSS_LIBRARY_PATH or LIBRARY_PATH | 6 | Add needed libraries and libc to RUNPATH when CROSS_LIBRARY_PATH or LIBRARY_PATH |
| 7 | is set. | 7 | is set. |
| 8 | --- | 8 | --- |
| 9 | lib/std/Build/Step/Compile.zig | 3 +++ | 9 | src/link/Elf.zig | 14 ++++++++++++++ |
| 10 | src/link/Elf.zig | 14 ++++++++++++++ | 10 | src/main.zig | 34 +++++++++++++++++++++++++++++++++- |
| 11 | src/main.zig | 34 +++++++++++++++++++++++++++++++++- | 11 | 2 files changed, 47 insertions(+), 1 deletion(-) |
| 12 | 3 files changed, 50 insertions(+), 1 deletion(-) | ||
| 13 | 12 | ||
| 14 | diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig | ||
| 15 | index 1dd444abf2..df7f4a56db 100644 | ||
| 16 | --- a/lib/std/Build/Step/Compile.zig | ||
| 17 | +++ b/lib/std/Build/Step/Compile.zig | ||
| 18 | @@ -778,6 +778,9 @@ fn runPkgConfig(compile: *Compile, lib_name: []const u8) !PkgConfigResult { | ||
| 19 | try zig_cflags.appendSlice(&[_][]const u8{ "-D", macro }); | ||
| 20 | } else if (mem.startsWith(u8, arg, "-D")) { | ||
| 21 | try zig_cflags.append(arg); | ||
| 22 | + } else if (mem.startsWith(u8, arg, "-Wl,-rpath=")) { | ||
| 23 | + const dir = arg["-Wl,-rpath=".len..]; | ||
| 24 | + try zig_libs.appendSlice(&[_][]const u8{ "-L", dir }); | ||
| 25 | } else if (b.debug_pkg_config) { | ||
| 26 | return compile.step.fail("unknown pkg-config flag '{s}'", .{arg}); | ||
| 27 | } | ||
| 28 | diff --git a/src/link/Elf.zig b/src/link/Elf.zig | 13 | diff --git a/src/link/Elf.zig b/src/link/Elf.zig |
| 29 | index 608ff2fe3a..2b9fe803fd 100644 | 14 | index 591786cfbc..253c7f6732 100644 |
| 30 | --- a/src/link/Elf.zig | 15 | --- a/src/link/Elf.zig |
| 31 | +++ b/src/link/Elf.zig | 16 | +++ b/src/link/Elf.zig |
| 32 | @@ -1037,6 +1037,13 @@ fn dumpArgvInit(self: *Elf, arena: Allocator) !void { | 17 | @@ -1054,6 +1054,13 @@ fn dumpArgvInit(self: *Elf, arena: Allocator) !void { |
| 33 | try argv.appendSlice(gpa, &.{ "-rpath", rpath }); | 18 | try argv.appendSlice(gpa, &.{ "-rpath", rpath }); |
| 34 | } | 19 | } |
| 35 | 20 | ||
| @@ -43,7 +28,7 @@ index 608ff2fe3a..2b9fe803fd 100644 | |||
| 43 | try argv.appendSlice(gpa, &.{ | 28 | try argv.appendSlice(gpa, &.{ |
| 44 | "-z", | 29 | "-z", |
| 45 | try std.fmt.allocPrint(arena, "stack-size={d}", .{self.base.stack_size}), | 30 | try std.fmt.allocPrint(arena, "stack-size={d}", .{self.base.stack_size}), |
| 46 | @@ -1857,6 +1864,13 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s | 31 | @@ -1888,6 +1895,13 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s |
| 47 | try argv.appendSlice(&.{ "-rpath", rpath }); | 32 | try argv.appendSlice(&.{ "-rpath", rpath }); |
| 48 | } | 33 | } |
| 49 | 34 | ||
| @@ -58,10 +43,10 @@ index 608ff2fe3a..2b9fe803fd 100644 | |||
| 58 | try argv.appendSlice(&.{ "-wrap", symbol_name }); | 43 | try argv.appendSlice(&.{ "-wrap", symbol_name }); |
| 59 | } | 44 | } |
| 60 | diff --git a/src/main.zig b/src/main.zig | 45 | diff --git a/src/main.zig b/src/main.zig |
| 61 | index 79493aa624..505bb7570a 100644 | 46 | index 141fd42aab..81cdf6a507 100644 |
| 62 | --- a/src/main.zig | 47 | --- a/src/main.zig |
| 63 | +++ b/src/main.zig | 48 | +++ b/src/main.zig |
| 64 | @@ -3901,7 +3901,7 @@ fn createModule( | 49 | @@ -4022,7 +4022,7 @@ fn createModule( |
| 65 | create_module.want_native_include_dirs = true; | 50 | create_module.want_native_include_dirs = true; |
| 66 | } | 51 | } |
| 67 | 52 | ||
| @@ -70,7 +55,7 @@ index 79493aa624..505bb7570a 100644 | |||
| 70 | try create_module.rpath_list.ensureUnusedCapacity(arena, create_module.lib_directories.items.len); | 55 | try create_module.rpath_list.ensureUnusedCapacity(arena, create_module.lib_directories.items.len); |
| 71 | for (create_module.lib_directories.items) |lib_directory| { | 56 | for (create_module.lib_directories.items) |lib_directory| { |
| 72 | create_module.rpath_list.appendAssumeCapacity(lib_directory.path.?); | 57 | create_module.rpath_list.appendAssumeCapacity(lib_directory.path.?); |
| 73 | @@ -3976,6 +3976,28 @@ fn createModule( | 58 | @@ -4096,6 +4096,28 @@ fn createModule( |
| 74 | else => {}, | 59 | else => {}, |
| 75 | }; | 60 | }; |
| 76 | 61 | ||
| @@ -99,7 +84,7 @@ index 79493aa624..505bb7570a 100644 | |||
| 99 | create_module.resolved_options = Compilation.Config.resolve(create_module.opts) catch |err| switch (err) { | 84 | create_module.resolved_options = Compilation.Config.resolve(create_module.opts) catch |err| switch (err) { |
| 100 | error.WasiExecModelRequiresWasi => fatal("only WASI OS targets support execution model", .{}), | 85 | error.WasiExecModelRequiresWasi => fatal("only WASI OS targets support execution model", .{}), |
| 101 | error.SharedMemoryIsWasmOnly => fatal("only WebAssembly CPU targets support shared memory", .{}), | 86 | error.SharedMemoryIsWasmOnly => fatal("only WebAssembly CPU targets support shared memory", .{}), |
| 102 | @@ -7495,3 +7517,13 @@ fn addLibDirectoryWarn2( | 87 | @@ -7748,3 +7770,13 @@ fn addLibDirectoryWarn2( |
| 103 | .path = path, | 88 | .path = path, |
| 104 | }); | 89 | }); |
| 105 | } | 90 | } |
| @@ -114,5 +99,5 @@ index 79493aa624..505bb7570a 100644 | |||
| 114 | + return true; | 99 | + return true; |
| 115 | +} | 100 | +} |
| 116 | -- | 101 | -- |
| 117 | 2.46.0 | 102 | 2.49.0 |
| 118 | 103 | ||
diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm index 23acfd19b1e..6b3f66095c7 100644 --- a/gnu/packages/zig.scm +++ b/gnu/packages/zig.scm | |||
| @@ -1861,12 +1861,12 @@ toolchain. Among other features it provides | |||
| 1861 | (package | 1861 | (package |
| 1862 | (inherit zig-0.13) | 1862 | (inherit zig-0.13) |
| 1863 | (name "zig") | 1863 | (name "zig") |
| 1864 | (version "0.14.0") | 1864 | (version "0.14.1") |
| 1865 | (source | 1865 | (source |
| 1866 | (origin | 1866 | (origin |
| 1867 | (inherit (zig-source | 1867 | (inherit (zig-source |
| 1868 | version version | 1868 | version version |
| 1869 | "0ndrwir81zhkwviwnzwqc4vszc1klv1fnlf66nmdwijrkqi5wasp")) | 1869 | "0cnc3bzl965ckm70ayd6a29zn5h9cy3qzyfncp4n7mzkiwhlj58f")) |
| 1870 | (patches | 1870 | (patches |
| 1871 | (search-patches | 1871 | (search-patches |
| 1872 | "zig-0.14-use-baseline-cpu-by-default.patch" | 1872 | "zig-0.14-use-baseline-cpu-by-default.patch" |
