| ... | ... | @@ -192,7 +192,7 @@ pub fn createEmpty( |
| 192 | 192 | null |
| 193 | 193 | else |
| 194 | 194 | try std.fmt.allocPrint(arena, "{s}.o", .{emit.sub_path}); |
| 195 | | const allow_shlib_undefined = options.allow_shlib_undefined orelse false; |
| 195 | const allow_shlib_undefined = options.allow_shlib_undefined orelse comp.config.any_sanitize_thread; |
| 196 | 196 | |
| 197 | 197 | const self = try arena.create(MachO); |
| 198 | 198 | self.* = .{ |
| ... | ... | @@ -411,6 +411,11 @@ pub fn flushModule(self: *MachO, arena: Allocator, prog_node: std.Progress.Node) |
| 411 | 411 | |
| 412 | 412 | if (module_obj_path) |path| try positionals.append(.{ .path = path }); |
| 413 | 413 | |
| 414 | // TSAN |
| 415 | if (comp.config.any_sanitize_thread) { |
| 416 | try positionals.append(.{ .path = comp.tsan_static_lib.?.full_object_path }); |
| 417 | } |
| 418 | |
| 414 | 419 | for (positionals.items) |obj| { |
| 415 | 420 | self.parsePositional(obj.path, obj.must_link) catch |err| switch (err) { |
| 416 | 421 | error.MalformedObject, |
| ... | ... | @@ -825,6 +830,10 @@ fn dumpArgv(self: *MachO, comp: *Compilation) !void { |
| 825 | 830 | try argv.append(p); |
| 826 | 831 | } |
| 827 | 832 | |
| 833 | if (comp.config.any_sanitize_thread) { |
| 834 | try argv.append(comp.tsan_static_lib.?.full_object_path); |
| 835 | } |
| 836 | |
| 828 | 837 | for (self.lib_dirs) |lib_dir| { |
| 829 | 838 | const arg = try std.fmt.allocPrint(arena, "-L{s}", .{lib_dir}); |
| 830 | 839 | try argv.append(arg); |