[compiler-rt] d669cc7 - [Sanitizer] Intercept clock_getcpuid/pthread_getcpuid on netbsd.

David Carlier via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 6 02:53:05 PDT 2021


Author: David Carlier
Date: 2021-09-06T10:51:51+01:00
New Revision: d669cc73212a443e6681adcc39632ecbe227f099

URL: https://github.com/llvm/llvm-project/commit/d669cc73212a443e6681adcc39632ecbe227f099
DIFF: https://github.com/llvm/llvm-project/commit/d669cc73212a443e6681adcc39632ecbe227f099.diff

LOG: [Sanitizer] Intercept clock_getcpuid/pthread_getcpuid on netbsd.

Reviewed By: mgorny

Differential Revision: https://reviews.llvm.org/D109278

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
    compiler-rt/test/sanitizer_common/TestCases/Posix/getcpuclockid.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
index bdb07ff132730..659b36a3007d0 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -229,7 +229,8 @@
   (SI_MAC || SI_LINUX_NOT_ANDROID || SI_SOLARIS)
 #define SANITIZER_INTERCEPT_CLOCK_GETTIME \
   (SI_FREEBSD || SI_NETBSD || SI_LINUX || SI_SOLARIS)
-#define SANITIZER_INTERCEPT_CLOCK_GETCPUCLOCKID (SI_LINUX || SI_FREEBSD)
+#define SANITIZER_INTERCEPT_CLOCK_GETCPUCLOCKID \
+  (SI_LINUX || SI_FREEBSD || SI_NETBSD)
 #define SANITIZER_INTERCEPT_GETITIMER SI_POSIX
 #define SANITIZER_INTERCEPT_TIME SI_POSIX
 #define SANITIZER_INTERCEPT_GLOB (SI_GLIBC || SI_SOLARIS)

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/getcpuclockid.c b/compiler-rt/test/sanitizer_common/TestCases/Posix/getcpuclockid.c
index 87ce3f5cddf38..7cd605e3249f8 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/getcpuclockid.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/getcpuclockid.c
@@ -1,6 +1,6 @@
 // RUN: %clang -pthread %s -Wl,-as-needed -o %t && %run %t
 //
-// UNSUPPORTED: darwin, netbsd, solaris
+// UNSUPPORTED: darwin, solaris
 
 #include <time.h>
 #include <unistd.h>


        


More information about the llvm-commits mailing list