authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-07-04 22:09:57+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-07-04 22:09:57+02:00
logd2cace58bd031e72b830ebd42f5946f4000e52a4
tree0de296fd724ee324307f9d64dec0b1f115a7469c
parente42e12dbbf8ebae65589ff08c3b5a454d2d67441

Compilation: rename tsan_static_lib to tsan_lib


5 files changed, 11 insertions(+), 19 deletions(-)

src/Compilation.zig+2-5
......@@ -185,12 +185,9 @@ libcxxabi_static_lib: ?CRTFile = null,
185185/// Populated when we build the libunwind static library. A Job to build this is placed in the queue
186186/// and resolved before calling linker.flush().
187187libunwind_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
189189/// and resolved before calling linker.flush().
190tsan_static_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().
193tsan_dynamic_lib: ?CRTFile = null,
190tsan_lib: ?CRTFile = null,
194191/// Populated when we build the libc static library. A Job to build this is placed in the queue
195192/// and resolved before calling linker.flush().
196193libc_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
339339 },
340340 };
341341
342 assert(comp.tsan_static_lib == null and comp.tsan_dynamic_lib == null);
343
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 }
342 assert(comp.tsan_lib == null);
343 comp.tsan_lib = try sub_compilation.toCrtFile();
349344}
350345
351346const 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
11451145
11461146 // TSAN
11471147 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 });
11491149 }
11501150
11511151 // libc
......@@ -1603,7 +1603,7 @@ fn dumpArgv(self: *Elf, comp: *Compilation) !void {
16031603 }
16041604
16051605 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);
16071607 }
16081608
16091609 // libc
......@@ -2610,7 +2610,7 @@ fn linkWithLLD(self: *Elf, arena: Allocator, prog_node: std.Progress.Node) !void
26102610 }
26112611
26122612 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);
26142614 }
26152615
26162616 // libc
src/link/MachO.zig+3-3
......@@ -413,7 +413,7 @@ pub fn flushModule(self: *MachO, arena: Allocator, prog_node: std.Progress.Node)
413413
414414 // TSAN
415415 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 });
417417 }
418418
419419 for (positionals.items) |obj| {
......@@ -831,7 +831,7 @@ fn dumpArgv(self: *MachO, comp: *Compilation) !void {
831831 }
832832
833833 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;
835835 try argv.append(path);
836836 try argv.appendSlice(&.{ "-rpath", std.fs.path.dirname(path) orelse "." });
837837 }
......@@ -3023,7 +3023,7 @@ fn writeLoadCommands(self: *MachO) !struct { usize, usize, u64 } {
30233023 ncmds += 1;
30243024 }
30253025 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;
30273027 const rpath = std.fs.path.dirname(path) orelse ".";
30283028 try load_commands.writeRpathLC(rpath, writer);
30293029 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
7272 }
7373
7474 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;
7676 const rpath = std.fs.path.dirname(path) orelse ".";
7777 sizeofcmds += calcInstallNameLen(
7878 @sizeOf(macho.rpath_command),