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
This commit is contained in:
Alex Rønne Petersen 2026-01-07 02:25:10 +01:00
parent 1bef876636
commit 28b83e3b02
No known key found for this signature in database

View file

@ -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