Skip to content

Commit

Permalink
fix macho linker integration with libfuzzer
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Jul 22, 2024
1 parent 1cb9948 commit 61ad1be
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/link/MachO.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 61ad1be

Please sign in to comment.