authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-01-07 02:25:10+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-01-07 02:25:10+01:00
log28b83e3b0274a52b1d02a4117edd9fc6636917de
tree71432f3de011c6462ec8d7137091877bbd30c8d5
parent1bef876636ab96449703ad2e8f9f22918546e99c
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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

1 files changed, 3 insertions(+), 0 deletions(-)

src/main.zig+3
...@@ -2498,6 +2498,9 @@ fn buildOutputType(...@@ -2498,6 +2498,9 @@ fn buildOutputType(
2498 // this ignores plain --sort-common2498 // this ignores plain --sort-common
2499 } else if (mem.eql(u8, arg, "-rpath") or mem.eql(u8, arg, "--rpath") or mem.eql(u8, arg, "-R")) {2499 } else if (mem.eql(u8, arg, "-rpath") or mem.eql(u8, arg, "--rpath") or mem.eql(u8, arg, "-R")) {
2500 try create_module.rpath_list.append(arena, linker_args_it.nextOrFatal());2500 try create_module.rpath_list.append(arena, linker_args_it.nextOrFatal());
2501 } else if (mem.eql(u8, arg, "-rpath-link") or mem.eql(u8, arg, "--rpath-link")) {
2502 _ = linker_args_it.nextOrFatal();
2503 warn("rpath-link option is unimplemented and ignored", .{});
2501 } else if (mem.eql(u8, arg, "--subsystem")) {2504 } else if (mem.eql(u8, arg, "--subsystem")) {
2502 subsystem = try parseSubsystem(linker_args_it.nextOrFatal());2505 subsystem = try parseSubsystem(linker_args_it.nextOrFatal());
2503 } else if (mem.eql(u8, arg, "-I") or2506 } else if (mem.eql(u8, arg, "-I") or