[PATCH] D56433: [NewPM] Port tsan
Dan Liew via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 9 06:25:45 PST 2019
delcypher added a comment.
@philip.pfaffe This patch got reverted (not by me r350719) because it broke TSan on macOS.
If I diff the LLVM IR between a working AppleClang and the important thing I see is
@.str = private unnamed_addr constant [7 x i8] c"hello\0A\00", align 1
- at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @tsan.module_ctor, i8* null }]
+ at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__tsan_init, i8* null }]
; Function Attrs: noinline norecurse optnone sanitize_thread ssp uwtable
define i32 @main() #0 personality i32 (...)* @__gcc_personality_v0 {
@@ -30,11 +30,6 @@
declare void @__tsan_init()
-define internal void @tsan.module_ctor() {
- call void @__tsan_init()
- ret void
-}
-
On macOS it seems dyld doesn't like `__tsan_init` being called directly from `llvm.global_ctors`. I get
dyld: initializer function 0x100129cd0 not in mapped image for <path_to_binary>
I don't know why this is.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56433/new/
https://reviews.llvm.org/D56433
More information about the llvm-commits
mailing list