[compiler-rt] fda76c4 - Revert "[msan] Don't intercept LFS prlimit64/getrlimit64 on musl"

Sam James via llvm-commits llvm-commits at lists.llvm.org
Sat May 20 18:44:19 PDT 2023


Author: Sam James
Date: 2023-05-21T02:44:14+01:00
New Revision: fda76c428f1e6c30198ce32522678182730801e4

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

LOG: Revert "[msan] Don't intercept LFS prlimit64/getrlimit64 on musl"

This reverts commit b297fd7974b282b66605547c7adb2eadbf82214f.

Reverting to investigate buildbot failures.

Added: 
    

Modified: 
    compiler-rt/lib/msan/msan_interceptors.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/msan/msan_interceptors.cpp b/compiler-rt/lib/msan/msan_interceptors.cpp
index 3ebcc7f26bf91..8cf724b3949f2 100644
--- a/compiler-rt/lib/msan/msan_interceptors.cpp
+++ b/compiler-rt/lib/msan/msan_interceptors.cpp
@@ -678,7 +678,7 @@ INTERCEPTOR(int, fstat, int fd, void *buf) {
 #define MSAN_MAYBE_INTERCEPT_FSTAT
 #endif
 
-#if SANITIZER_GLIBC
+#if SANITIZER_STAT_LINUX
 INTERCEPTOR(int, fstat64, int fd, void *buf) {
   ENSURE_MSAN_INITED();
   int res = REAL(fstat64)(fd, buf);
@@ -825,7 +825,6 @@ INTERCEPTOR(int, __getrlimit, int resource, void *rlim) {
   INTERCEPTOR_GETRLIMIT_BODY(__getrlimit, resource, rlim);
 }
 
-#if SANITIZER_GLIBC
 INTERCEPTOR(int, getrlimit64, int resource, void *rlim) {
   if (msan_init_is_running) return REAL(getrlimit64)(resource, rlim);
   ENSURE_MSAN_INITED();
@@ -833,9 +832,6 @@ INTERCEPTOR(int, getrlimit64, int resource, void *rlim) {
   if (!res) __msan_unpoison(rlim, __sanitizer::struct_rlimit64_sz);
   return res;
 }
-#else
-#define MSAN_MAYBE_INTERCEPT_GETRLIMIT64 INTERCEPT_FUNCTION(getrlimit64)
-#endif
 
 INTERCEPTOR(int, prlimit, int pid, int resource, void *new_rlimit,
             void *old_rlimit) {
@@ -848,7 +844,6 @@ INTERCEPTOR(int, prlimit, int pid, int resource, void *new_rlimit,
   return res;
 }
 
-#if SANITIZER_GLIBC
 INTERCEPTOR(int, prlimit64, int pid, int resource, void *new_rlimit,
             void *old_rlimit) {
   if (msan_init_is_running)
@@ -859,9 +854,6 @@ INTERCEPTOR(int, prlimit64, int pid, int resource, void *new_rlimit,
   if (!res) __msan_unpoison(old_rlimit, __sanitizer::struct_rlimit64_sz);
   return res;
 }
-#else
-#define MSAN_MAYBE_INTERCEPT_PRLIMIT64 INTERCEPT_FUNCTION(prlimit64)
-#endif
 
 #define MSAN_MAYBE_INTERCEPT___GETRLIMIT INTERCEPT_FUNCTION(__getrlimit)
 #define MSAN_MAYBE_INTERCEPT_GETRLIMIT64 INTERCEPT_FUNCTION(getrlimit64)
@@ -1785,13 +1777,9 @@ void InitializeInterceptors() {
   MSAN_MAYBE_INTERCEPT_FGETS_UNLOCKED;
   INTERCEPT_FUNCTION(getrlimit);
   MSAN_MAYBE_INTERCEPT___GETRLIMIT;
-#if SANITIZER_GLIBC
   MSAN_MAYBE_INTERCEPT_GETRLIMIT64;
-#endif
   MSAN_MAYBE_INTERCEPT_PRLIMIT;
-#if SANITIZER_GLIBC
   MSAN_MAYBE_INTERCEPT_PRLIMIT64;
-#endif
   INTERCEPT_FUNCTION(gethostname);
   MSAN_MAYBE_INTERCEPT_EPOLL_WAIT;
   MSAN_MAYBE_INTERCEPT_EPOLL_PWAIT;


        


More information about the llvm-commits mailing list