You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// For executables, clang's -fsanitize=address statically embeds the full
132
-
// ASan runtime (--whole-archive libclang_rt.asan*.a). Adding an explicit
133
-
// -lclang_rt.asan or -lasan on top produces a second dynamic NEEDED entry,
134
-
// which triggers "incompatible ASan runtimes" at startup (two __asan_init
135
-
// calls). Strip the explicit sanitizer -l/-L/-rpath flags here so the
136
-
// executable relies solely on clang's automatic static embedding.
137
-
val sanitizerLibPattern =Regex("^(-lasan|-lubsan|-lclang_rt\\.asan.*|-lclang_rt\\.ubsan.*|-L.*/clang.*/|-Wl,-rpath,.*/clang.*/)")
131
+
// Strip explicit sanitizer -l/-L/-rpath flags so the executable relies solely
132
+
// on clang's automatic static embedding of the sanitizer runtime. Mixing
133
+
// clang's statically-embedded runtime with an explicit GCC libtsan/libasan
134
+
// causes "incompatible runtimes" at startup (two __tsan_init/__asan_init calls).
135
+
val sanitizerLibPattern =Regex("^(-lasan|-lubsan|-ltsan|-lclang_rt\\.asan.*|-lclang_rt\\.ubsan.*|-lclang_rt\\.tsan.*|-L.*/clang.*/|-Wl,-rpath,.*/clang/.*)")
138
136
val linkerArgs = config.linkerArgs.get().filter { !sanitizerLibPattern.containsMatchIn(it) }
139
137
val objDir = project.file("${project.layout.buildDirectory.get()}/obj/gtest/${config.name}/$testName")
140
138
val binary = project.file("${project.layout.buildDirectory.get()}/bin/gtest/${config.name}_$testName/$testName")
0 commit comments