diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2023-03-24 07:22:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-24 07:22:05 +0100 |
| commit | f99b75360db55413f4accf43a6f4161b14a5de9f (patch) | |
| tree | bb57058b7ac0006f62813de35ce8b610587ee433 /lib/std/Build/CompileStep.zig | |
| parent | 3aa0a7ecdf3f88d0d37e20c88bf57b69355573fe (diff) | |
| parent | 145f93ba961fb9eea66a39b60e93c2aa5e26ee40 (diff) | |
| download | zig-f99b75360db55413f4accf43a6f4161b14a5de9f.tar.gz zig-f99b75360db55413f4accf43a6f4161b14a5de9f.zip | |
Merge pull request #15061 from ziglang/fix-15036
build: fix adding rpaths on darwin, improve CheckObjectStep to allow matching FileSource paths
Diffstat (limited to 'lib/std/Build/CompileStep.zig')
| -rw-r--r-- | lib/std/Build/CompileStep.zig | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/std/Build/CompileStep.zig b/lib/std/Build/CompileStep.zig index 72855f360e..2747f56af2 100644 --- a/lib/std/Build/CompileStep.zig +++ b/lib/std/Build/CompileStep.zig @@ -1725,6 +1725,22 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { try zig_args.ensureUnusedCapacity(2 * self.rpaths.items.len); for (self.rpaths.items) |rpath| { zig_args.appendAssumeCapacity("-rpath"); + + if (self.target_info.target.isDarwin()) switch (rpath) { + .path => |path| { + // On Darwin, we should not try to expand special runtime paths such as + // * @executable_path + // * @loader_path + if (mem.startsWith(u8, path, "@executable_path") or + mem.startsWith(u8, path, "@loader_path")) + { + zig_args.appendAssumeCapacity(path); + continue; + } + }, + .generated => {}, + }; + zig_args.appendAssumeCapacity(rpath.getPath2(b, step)); } |
