From 28b83e3b0274a52b1d02a4117edd9fc6636917de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 7 Jan 2026 02:25:10 +0100 Subject: [PATCH] compiler: recognize and ignore -rpath-link linker option The option should probably still be implemented properly at some point, but LLD has ignored this for years and nobody seems to mind, so just do the same for now. This unblocks using zig cc with CMake on OpenBSD, among other use cases. ref https://github.com/ziglang/zig/issues/18713 --- src/main.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.zig b/src/main.zig index aa6338b19cd265cbf908382a3c2435427ec26988..1f373b2340dc4c8bc1084c7e5b87511105b3b5f6 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2498,6 +2498,9 @@ fn buildOutputType( // this ignores plain --sort-common } else if (mem.eql(u8, arg, "-rpath") or mem.eql(u8, arg, "--rpath") or mem.eql(u8, arg, "-R")) { try create_module.rpath_list.append(arena, linker_args_it.nextOrFatal()); + } else if (mem.eql(u8, arg, "-rpath-link") or mem.eql(u8, arg, "--rpath-link")) { + _ = linker_args_it.nextOrFatal(); + warn("rpath-link option is unimplemented and ignored", .{}); } else if (mem.eql(u8, arg, "--subsystem")) { subsystem = try parseSubsystem(linker_args_it.nextOrFatal()); } else if (mem.eql(u8, arg, "-I") or -- 2.54.0