summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/zig-0.14-fix-runpath.patch
diff options
context:
space:
mode:
authorHilton Chain <hako@ultrarare.space>2025-05-25 20:19:49 +0800
committerHilton Chain <hako@ultrarare.space>2025-05-25 20:56:44 +0800
commit19af5b3845a47016559f856f0cd91e3591091b7b (patch)
tree0338bab7a611ef67ae83b35ab42c730a4bc6da24 /gnu/packages/patches/zig-0.14-fix-runpath.patch
parentfa48957a400ee6889cbe422fba2aff09004dbdac (diff)
gnu: zig-0.14: Fix library search for ‘-Wl,-rpath=’ pkg-config flag.
This is a follow-up to commit 8b809c331173388dcb6c0e88178d6cc76a1da3b1, where I removed handling of ‘-Wl,-rpath=’ pkg-config flag from the patch and this broke build of ncdu. * gnu/packages/patches/zig-0.14-fix-runpath.patch: Add back handling of ‘-Wl,-rpath=’ pkg-config flag. Change-Id: Ifdd6885d376ed39d6702431055f77bdae5ae6439
Diffstat (limited to 'gnu/packages/patches/zig-0.14-fix-runpath.patch')
-rw-r--r--gnu/packages/patches/zig-0.14-fix-runpath.patch22
1 files changed, 18 insertions, 4 deletions
diff --git a/gnu/packages/patches/zig-0.14-fix-runpath.patch b/gnu/packages/patches/zig-0.14-fix-runpath.patch
index 3bfe637191..21fa78bac2 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 @@
-From 467261b7e31dbb56aa06318bdd2e7260a80b313a Mon Sep 17 00:00:00 2001
+From c531a68b2dc5d96a50c1783d5f266e8c5b9c456e 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.
@@ -6,10 +6,24 @@ Subject: [PATCH] Fix RUNPATH issue.
Add needed libraries and libc to RUNPATH when CROSS_LIBRARY_PATH or LIBRARY_PATH
is set.
---
- src/link/Elf.zig | 14 ++++++++++++++
- src/main.zig | 34 +++++++++++++++++++++++++++++++++-
- 2 files changed, 47 insertions(+), 1 deletion(-)
+ lib/std/Build/Step/Compile.zig | 2 ++
+ src/link/Elf.zig | 14 ++++++++++++++
+ src/main.zig | 34 +++++++++++++++++++++++++++++++++-
+ 3 files changed, 49 insertions(+), 1 deletion(-)
+diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig
+index c401a840ba..44ced5823f 100644
+--- a/lib/std/Build/Step/Compile.zig
++++ b/lib/std/Build/Step/Compile.zig
+@@ -787,6 +787,8 @@ fn runPkgConfig(compile: *Compile, lib_name: []const u8) !PkgConfigResult {
+ try zig_cflags.append(arg);
+ } else if (mem.startsWith(u8, arg, wl_rpath_prefix)) {
+ try zig_cflags.appendSlice(&[_][]const u8{ "-rpath", arg[wl_rpath_prefix.len..] });
++ } else if (mem.startsWith(u8, arg, "-Wl,-rpath=")) {
++ try zig_libs.appendSlice(&[_][]const u8{ "-L", arg["-Wl,-rpath=".len..] });
+ } 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 591786cfbc..253c7f6732 100644
--- a/src/link/Elf.zig