| author | |
| committer | |
| log | b9225aea780a230971f1ae4b4e0b95b31f0a3e1d |
| tree | 2f26acf4d861eb2ea379cc366130d46cb33d8ea4 |
| parent | 7802cf9814c135437863ce742b9951d7656849cd |
3 files changed, 26 insertions(+), 2 deletions(-)
src/link/Coff/lld.zig+4| ... | ... | @@ -460,6 +460,10 @@ pub fn linkWithLLD(self: *Coff, arena: Allocator, tid: Zcu.PerThread.Id, prog_no |
| 460 | 460 | try argv.append(comp.libunwind_static_lib.?.full_object_path); |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | if (comp.config.any_fuzz) { | |
| 464 | try argv.append(comp.fuzzer_lib.?.full_object_path); | |
| 465 | } | |
| 466 | ||
| 463 | 467 | if (is_exe_or_dyn_lib and !comp.skip_linker_dependencies) { |
| 464 | 468 | if (!comp.config.link_libc) { |
| 465 | 469 | if (comp.libc_static_lib) |lib| { |
src/link/Elf.zig+13-1| ... | ... | @@ -1144,11 +1144,14 @@ pub fn flushModule(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_nod |
| 1144 | 1144 | _ = try rpath_table.put(rpath, {}); |
| 1145 | 1145 | } |
| 1146 | 1146 | |
| 1147 | // TSAN | |
| 1148 | 1147 | if (comp.config.any_sanitize_thread) { |
| 1149 | 1148 | try positionals.append(.{ .path = comp.tsan_lib.?.full_object_path }); |
| 1150 | 1149 | } |
| 1151 | 1150 | |
| 1151 | if (comp.config.any_fuzz) { | |
| 1152 | try positionals.append(.{ .path = comp.fuzzer_lib.?.full_object_path }); | |
| 1153 | } | |
| 1154 | ||
| 1152 | 1155 | // libc |
| 1153 | 1156 | if (!comp.skip_linker_dependencies and !comp.config.link_libc) { |
| 1154 | 1157 | if (comp.libc_static_lib) |lib| { |
| ... | ... | @@ -1607,6 +1610,10 @@ fn dumpArgv(self: *Elf, comp: *Compilation) !void { |
| 1607 | 1610 | try argv.append(comp.tsan_lib.?.full_object_path); |
| 1608 | 1611 | } |
| 1609 | 1612 | |
| 1613 | if (comp.config.any_fuzz) { | |
| 1614 | try argv.append(comp.fuzzer_lib.?.full_object_path); | |
| 1615 | } | |
| 1616 | ||
| 1610 | 1617 | // libc |
| 1611 | 1618 | if (!comp.skip_linker_dependencies and !comp.config.link_libc) { |
| 1612 | 1619 | if (comp.libc_static_lib) |lib| { |
| ... | ... | @@ -2272,6 +2279,7 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s |
| 2272 | 2279 | man.hash.add(self.bind_global_refs_locally); |
| 2273 | 2280 | man.hash.add(self.compress_debug_sections); |
| 2274 | 2281 | man.hash.add(comp.config.any_sanitize_thread); |
| 2282 | man.hash.add(comp.config.any_fuzz); | |
| 2275 | 2283 | man.hash.addOptionalBytes(comp.sysroot); |
| 2276 | 2284 | |
| 2277 | 2285 | // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock. |
| ... | ... | @@ -2616,6 +2624,10 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s |
| 2616 | 2624 | try argv.append(comp.tsan_lib.?.full_object_path); |
| 2617 | 2625 | } |
| 2618 | 2626 | |
| 2627 | if (comp.config.any_fuzz) { | |
| 2628 | try argv.append(comp.fuzzer_lib.?.full_object_path); | |
| 2629 | } | |
| 2630 | ||
| 2619 | 2631 | // libc |
| 2620 | 2632 | if (is_exe_or_dyn_lib and |
| 2621 | 2633 | !comp.skip_linker_dependencies and |
src/link/MachO.zig+9-1| ... | ... | @@ -389,11 +389,14 @@ pub fn flushModule(self: *MachO, arena: Allocator, tid: Zcu.PerThread.Id, prog_n |
| 389 | 389 | |
| 390 | 390 | if (module_obj_path) |path| try positionals.append(.{ .path = path }); |
| 391 | 391 | |
| 392 | // TSAN | |
| 393 | 392 | if (comp.config.any_sanitize_thread) { |
| 394 | 393 | try positionals.append(.{ .path = comp.tsan_lib.?.full_object_path }); |
| 395 | 394 | } |
| 396 | 395 | |
| 396 | if (comp.config.any_fuzz) { | |
| 397 | try positionals.append(.{ .path = comp.fuzzer_lib.?.full_object_path }); | |
| 398 | } | |
| 399 | ||
| 397 | 400 | for (positionals.items) |obj| { |
| 398 | 401 | self.parsePositional(obj.path, obj.must_link) catch |err| switch (err) { |
| 399 | 402 | error.MalformedObject, |
| ... | ... | @@ -462,6 +465,11 @@ pub fn flushModule(self: *MachO, arena: Allocator, tid: Zcu.PerThread.Id, prog_n |
| 462 | 465 | }; |
| 463 | 466 | } |
| 464 | 467 | |
| 468 | if (comp.fuzzer_lib) |fuzzer_lib| { | |
| 469 | _ = fuzzer_lib.full_object_path; | |
| 470 | log.err("TODO macho linking code for adding libfuzzer", .{}); | |
| 471 | } | |
| 472 | ||
| 465 | 473 | // Finally, link against compiler_rt. |
| 466 | 474 | const compiler_rt_path: ?[]const u8 = blk: { |
| 467 | 475 | if (comp.compiler_rt_lib) |x| break :blk x.full_object_path; |