authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-07-04 07:26:28+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-07-04 07:33:00+02:00
log76c3b6b794ebc9ddb910e369bbf2d121a01e06d8
tree40241f70098f7304424910a9033e2a3413b1b733
parentc9d19ebb7a3d6996ec8b299d1698adf6737d73e5

tsan: add workaround for TSAN Apple bug

Addresses TSAN bug on Apple platforms by always setting the headerpad size to a non-zero value when building the TSAN dylib.

1 files changed, 3 insertions(+), 0 deletions(-)

src/libtsan.zig+3
......@@ -290,6 +290,8 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo
290290 try std.fmt.allocPrintZ(arena, "@rpath/{s}", .{basename})
291291 else
292292 null;
293 // This is temp conditional on resolving https://github.com/llvm/llvm-project/issues/97627 upstream.
294 const headerpad_size: ?u32 = if (target.isDarwin()) 32 else null;
293295 const sub_compilation = Compilation.create(comp.gpa, arena, .{
294296 .local_cache_directory = comp.global_cache_directory,
295297 .global_cache_directory = comp.global_cache_directory,
......@@ -315,6 +317,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo
315317 .skip_linker_dependencies = skip_linker_dependencies,
316318 .linker_allow_shlib_undefined = linker_allow_shlib_undefined,
317319 .install_name = install_name,
320 .headerpad_size = headerpad_size,
318321 }) catch |err| {
319322 comp.setMiscFailure(
320323 .libtsan,