[compiler-rt] [tsan] Make pthread_mutex_clocklock Linux only again (PR #76187)
Dan McGregor via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 21 13:41:34 PST 2023
https://github.com/dankm updated https://github.com/llvm/llvm-project/pull/76187
>From b3aba515978e24b45dc6dfc5d0889aa38eb913ed Mon Sep 17 00:00:00 2001
From: Dan McGregor <dan.mcgregor at usask.ca>
Date: Thu, 21 Dec 2023 14:20:36 -0600
Subject: [PATCH] [tsan] Make pthread_mutex_clocklock Linux only again
Similar to e77731722755, but also avoid declaring
pthread_mutex_clocklock on non-Linux.
---
compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
index fdcba6e8ca7398..a9f6673ac44e90 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
@@ -2918,7 +2918,9 @@ void InitializeInterceptors() {
TSAN_INTERCEPT(pthread_mutex_trylock);
TSAN_INTERCEPT(pthread_mutex_timedlock);
TSAN_INTERCEPT(pthread_mutex_unlock);
+#if SANITIZER_LINUX
TSAN_INTERCEPT(pthread_mutex_clocklock);
+#endif
#if SANITIZER_GLIBC
# if !__GLIBC_PREREQ(2, 34)
TSAN_INTERCEPT(__pthread_mutex_lock);
More information about the llvm-commits
mailing list