aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-07-22 13:28:21 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-07-22 14:26:17 -0700
commit61ad1be6bd7d27f79773e7da891898449a45a80e (patch)
tree1f7efe3f1e4fc6b1b910487b306ea8b122bcddc1
parent1cb994899db9cc173982ce9bce4099059e2700af (diff)
downloadzig-61ad1be6bd7d27f79773e7da891898449a45a80e.tar.gz
zig-61ad1be6bd7d27f79773e7da891898449a45a80e.zip
fix macho linker integration with libfuzzer
-rw-r--r--src/link/MachO.zig9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
index 4c7b7c3066..1b4a80e6fc 100644
--- a/src/link/MachO.zig
+++ b/src/link/MachO.zig
@@ -465,11 +465,6 @@ pub fn flushModule(self: *MachO, arena: Allocator, tid: Zcu.PerThread.Id, prog_n
};
}
- if (comp.fuzzer_lib) |fuzzer_lib| {
- _ = fuzzer_lib.full_object_path;
- log.err("TODO macho linking code for adding libfuzzer", .{});
- }
-
// Finally, link against compiler_rt.
const compiler_rt_path: ?[]const u8 = blk: {
if (comp.compiler_rt_lib) |x| break :blk x.full_object_path;
@@ -767,6 +762,10 @@ fn dumpArgv(self: *MachO, comp: *Compilation) !void {
try argv.appendSlice(&.{ "-rpath", std.fs.path.dirname(path) orelse "." });
}
+ if (comp.config.any_fuzz) {
+ try argv.append(comp.fuzzer_lib.?.full_object_path);
+ }
+
for (self.lib_dirs) |lib_dir| {
const arg = try std.fmt.allocPrint(arena, "-L{s}", .{lib_dir});
try argv.append(arg);