diff options
author | Hilton Chain <[email protected]> | 2024-11-11 11:10:16 +0800 |
---|---|---|
committer | Hilton Chain <[email protected]> | 2024-12-31 10:54:15 +0800 |
commit | ab8979321881e59777da31ad11e77d5e482ff843 (patch) | |
tree | 34c3d8cda8a51dd023306fa8297220113119db2f /gnu/packages/patches/zig-0.11-fix-runpath.patch | |
parent | 654e058538754f35eabf63e729243930140de89b (diff) |
gnu: Add zig-0.11.
* gnu/packages/patches/zig-0.11-fix-runpath.patch: New file.
* gnu/packages/patches/zig-0.11-use-system-paths.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register them.
* gnu/packages/zig.scm (zig-0.11-glibc-abi-tool,zig-0.11): New variables.
Change-Id: I2507af62918f3989967d55dec942b84655d6d8bd
Diffstat (limited to 'gnu/packages/patches/zig-0.11-fix-runpath.patch')
-rw-r--r-- | gnu/packages/patches/zig-0.11-fix-runpath.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/gnu/packages/patches/zig-0.11-fix-runpath.patch b/gnu/packages/patches/zig-0.11-fix-runpath.patch new file mode 100644 index 0000000000..1c9e892874 --- /dev/null +++ b/gnu/packages/patches/zig-0.11-fix-runpath.patch @@ -0,0 +1,45 @@ +From 4a5397b856564d0fbc0b89186e682e6694a909b0 Mon Sep 17 00:00:00 2001 +From: Hilton Chain <[email protected]> +Date: Wed, 27 Nov 2024 11:55:44 +0800 +Subject: [PATCH] Fix RUNPATH issue. + +Add needed libraries and libc to RUNPATH when CROSS_LIBRARY_PATH or LIBRARY_PATH +is set. +--- + src/Compilation.zig | 2 +- + src/link/Elf.zig | 6 ++++++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/Compilation.zig b/src/Compilation.zig +index a08c3e09f4..add374d0ba 100644 +--- a/src/Compilation.zig ++++ b/src/Compilation.zig +@@ -1542,7 +1542,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { + .llvm_cpu_features = llvm_cpu_features, + .skip_linker_dependencies = options.skip_linker_dependencies, + .parent_compilation_link_libc = options.parent_compilation_link_libc, +- .each_lib_rpath = options.each_lib_rpath orelse false, ++ .each_lib_rpath = std.zig.system.NativePaths.isGuix(arena) or options.each_lib_rpath orelse false, + .build_id = build_id, + .cache_mode = cache_mode, + .disable_lld_caching = options.disable_lld_caching or cache_mode == .whole, +diff --git a/src/link/Elf.zig b/src/link/Elf.zig +index dd88d47fab..b6e3944725 100644 +--- a/src/link/Elf.zig ++++ b/src/link/Elf.zig +@@ -1730,6 +1730,12 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v + } + } + } ++ if (self.base.options.link_libc and self.base.options.link_mode == .Dynamic) { ++ if (self.base.options.libc_installation) |libc_installation| { ++ try argv.append("-rpath"); ++ try argv.append(libc_installation.crt_dir.?); ++ } ++ } + } + + for (self.base.options.lib_dirs) |lib_dir| { +-- +2.46.0 + |