| author | |
| committer | |
| log | d2cace58bd031e72b830ebd42f5946f4000e52a4 |
| tree | 0de296fd724ee324307f9d64dec0b1f115a7469c |
| parent | e42e12dbbf8ebae65589ff08c3b5a454d2d67441 |
5 files changed, 11 insertions(+), 19 deletions(-)
src/Compilation.zig+2-5| ... | @@ -185,12 +185,9 @@ libcxxabi_static_lib: ?CRTFile = null, | ... | @@ -185,12 +185,9 @@ libcxxabi_static_lib: ?CRTFile = null, |
| 185 | /// Populated when we build the libunwind static library. A Job to build this is placed in the queue | 185 | /// Populated when we build the libunwind static library. A Job to build this is placed in the queue |
| 186 | /// and resolved before calling linker.flush(). | 186 | /// and resolved before calling linker.flush(). |
| 187 | libunwind_static_lib: ?CRTFile = null, | 187 | libunwind_static_lib: ?CRTFile = null, |
| 188 | /// Populated when we build the TSAN static library. A Job to build this is placed in the queue | 188 | /// Populated when we build the TSAN library. A Job to build this is placed in the queue |
| 189 | /// and resolved before calling linker.flush(). | 189 | /// and resolved before calling linker.flush(). |
| 190 | tsan_static_lib: ?CRTFile = null, | 190 | tsan_lib: ?CRTFile = null, |
| 191 | /// Populated when we build the TSAN dynamic library. A Job to build this is placed in the queue | ||
| 192 | /// and resolved before calling linker.flush(). | ||
| 193 | tsan_dynamic_lib: ?CRTFile = null, | ||
| 194 | /// Populated when we build the libc static library. A Job to build this is placed in the queue | 191 | /// Populated when we build the libc static library. A Job to build this is placed in the queue |
| 195 | /// and resolved before calling linker.flush(). | 192 | /// and resolved before calling linker.flush(). |
| 196 | libc_static_lib: ?CRTFile = null, | 193 | libc_static_lib: ?CRTFile = null, |
src/libtsan.zig+2-7| ... | @@ -339,13 +339,8 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo | ... | @@ -339,13 +339,8 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo |
| 339 | }, | 339 | }, |
| 340 | }; | 340 | }; |
| 341 | 341 | ||
| 342 | assert(comp.tsan_static_lib == null and comp.tsan_dynamic_lib == null); | 342 | assert(comp.tsan_lib == null); |
| 343 | 343 | comp.tsan_lib = try sub_compilation.toCrtFile(); | |
| 344 | if (target.isDarwin()) { | ||
| 345 | comp.tsan_dynamic_lib = try sub_compilation.toCrtFile(); | ||
| 346 | } else { | ||
| 347 | comp.tsan_static_lib = try sub_compilation.toCrtFile(); | ||
| 348 | } | ||
| 349 | } | 344 | } |
| 350 | 345 | ||
| 351 | const tsan_sources = [_][]const u8{ | 346 | const tsan_sources = [_][]const u8{ |
src/link/Elf.zig+3-3| ... | @@ -1145,7 +1145,7 @@ pub fn flushModule(self: *Elf, arena: Allocator, prog_node: std.Progress.Node) l | ... | @@ -1145,7 +1145,7 @@ pub fn flushModule(self: *Elf, arena: Allocator, prog_node: std.Progress.Node) l |
| 1145 | 1145 | ||
| 1146 | // TSAN | 1146 | // TSAN |
| 1147 | if (comp.config.any_sanitize_thread) { | 1147 | if (comp.config.any_sanitize_thread) { |
| 1148 | try positionals.append(.{ .path = comp.tsan_static_lib.?.full_object_path }); | 1148 | try positionals.append(.{ .path = comp.tsan_lib.?.full_object_path }); |
| 1149 | } | 1149 | } |
| 1150 | 1150 | ||
| 1151 | // libc | 1151 | // libc |
| ... | @@ -1603,7 +1603,7 @@ fn dumpArgv(self: *Elf, comp: *Compilation) !void { | ... | @@ -1603,7 +1603,7 @@ fn dumpArgv(self: *Elf, comp: *Compilation) !void { |
| 1603 | } | 1603 | } |
| 1604 | 1604 | ||
| 1605 | if (comp.config.any_sanitize_thread) { | 1605 | if (comp.config.any_sanitize_thread) { |
| 1606 | try argv.append(comp.tsan_static_lib.?.full_object_path); | 1606 | try argv.append(comp.tsan_lib.?.full_object_path); |
| 1607 | } | 1607 | } |
| 1608 | 1608 | ||
| 1609 | // libc | 1609 | // libc |
| ... | @@ -2610,7 +2610,7 @@ fn linkWithLLD(self: *Elf, arena: Allocator, prog_node: std.Progress.Node) !void | ... | @@ -2610,7 +2610,7 @@ fn linkWithLLD(self: *Elf, arena: Allocator, prog_node: std.Progress.Node) !void |
| 2610 | } | 2610 | } |
| 2611 | 2611 | ||
| 2612 | if (comp.config.any_sanitize_thread) { | 2612 | if (comp.config.any_sanitize_thread) { |
| 2613 | try argv.append(comp.tsan_static_lib.?.full_object_path); | 2613 | try argv.append(comp.tsan_lib.?.full_object_path); |
| 2614 | } | 2614 | } |
| 2615 | 2615 | ||
| 2616 | // libc | 2616 | // libc |
src/link/MachO.zig+3-3| ... | @@ -413,7 +413,7 @@ pub fn flushModule(self: *MachO, arena: Allocator, prog_node: std.Progress.Node) | ... | @@ -413,7 +413,7 @@ pub fn flushModule(self: *MachO, arena: Allocator, prog_node: std.Progress.Node) |
| 413 | 413 | ||
| 414 | // TSAN | 414 | // TSAN |
| 415 | if (comp.config.any_sanitize_thread) { | 415 | if (comp.config.any_sanitize_thread) { |
| 416 | try positionals.append(.{ .path = comp.tsan_dynamic_lib.?.full_object_path }); | 416 | try positionals.append(.{ .path = comp.tsan_lib.?.full_object_path }); |
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | for (positionals.items) |obj| { | 419 | for (positionals.items) |obj| { |
| ... | @@ -831,7 +831,7 @@ fn dumpArgv(self: *MachO, comp: *Compilation) !void { | ... | @@ -831,7 +831,7 @@ fn dumpArgv(self: *MachO, comp: *Compilation) !void { |
| 831 | } | 831 | } |
| 832 | 832 | ||
| 833 | if (comp.config.any_sanitize_thread) { | 833 | if (comp.config.any_sanitize_thread) { |
| 834 | const path = comp.tsan_dynamic_lib.?.full_object_path; | 834 | const path = comp.tsan_lib.?.full_object_path; |
| 835 | try argv.append(path); | 835 | try argv.append(path); |
| 836 | try argv.appendSlice(&.{ "-rpath", std.fs.path.dirname(path) orelse "." }); | 836 | try argv.appendSlice(&.{ "-rpath", std.fs.path.dirname(path) orelse "." }); |
| 837 | } | 837 | } |
| ... | @@ -3023,7 +3023,7 @@ fn writeLoadCommands(self: *MachO) !struct { usize, usize, u64 } { | ... | @@ -3023,7 +3023,7 @@ fn writeLoadCommands(self: *MachO) !struct { usize, usize, u64 } { |
| 3023 | ncmds += 1; | 3023 | ncmds += 1; |
| 3024 | } | 3024 | } |
| 3025 | if (comp.config.any_sanitize_thread) { | 3025 | if (comp.config.any_sanitize_thread) { |
| 3026 | const path = comp.tsan_dynamic_lib.?.full_object_path; | 3026 | const path = comp.tsan_lib.?.full_object_path; |
| 3027 | const rpath = std.fs.path.dirname(path) orelse "."; | 3027 | const rpath = std.fs.path.dirname(path) orelse "."; |
| 3028 | try load_commands.writeRpathLC(rpath, writer); | 3028 | try load_commands.writeRpathLC(rpath, writer); |
| 3029 | ncmds += 1; | 3029 | ncmds += 1; |
src/link/MachO/load_commands.zig+1-1| ... | @@ -72,7 +72,7 @@ pub fn calcLoadCommandsSize(macho_file: *MachO, assume_max_path_len: bool) !u32 | ... | @@ -72,7 +72,7 @@ pub fn calcLoadCommandsSize(macho_file: *MachO, assume_max_path_len: bool) !u32 |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | if (comp.config.any_sanitize_thread) { | 74 | if (comp.config.any_sanitize_thread) { |
| 75 | const path = comp.tsan_dynamic_lib.?.full_object_path; | 75 | const path = comp.tsan_lib.?.full_object_path; |
| 76 | const rpath = std.fs.path.dirname(path) orelse "."; | 76 | const rpath = std.fs.path.dirname(path) orelse "."; |
| 77 | sizeofcmds += calcInstallNameLen( | 77 | sizeofcmds += calcInstallNameLen( |
| 78 | @sizeOf(macho.rpath_command), | 78 | @sizeOf(macho.rpath_command), |