mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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
This commit is contained in:
parent
654e058538
commit
ab89793218
4 changed files with 254 additions and 0 deletions
45
gnu/packages/patches/zig-0.11-fix-runpath.patch
Normal file
45
gnu/packages/patches/zig-0.11-fix-runpath.patch
Normal file
|
@ -0,0 +1,45 @@
|
|||
From 4a5397b856564d0fbc0b89186e682e6694a909b0 Mon Sep 17 00:00:00 2001
|
||||
From: Hilton Chain <hako@ultrarare.space>
|
||||
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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue