Don't link lsan rt if asan or hwasan are enabled

This commit is contained in:
David Koloski 2024-05-15 15:40:53 +00:00
parent 1b934f3e8c
commit 5976494deb

View File

@ -1229,7 +1229,10 @@ fn add_sanitizer_libraries(
if sanitizer.contains(SanitizerSet::DATAFLOW) {
link_sanitizer_runtime(sess, flavor, linker, "dfsan");
}
if sanitizer.contains(SanitizerSet::LEAK) {
if sanitizer.contains(SanitizerSet::LEAK)
&& !sanitizer.contains(SanitizerSet::ADDRESS)
&& !sanitizer.contains(SanitizerSet::HWADDRESS)
{
link_sanitizer_runtime(sess, flavor, linker, "lsan");
}
if sanitizer.contains(SanitizerSet::MEMORY) {