[compiler-rt] a31e253 - [compiler-rt][rtsan] Fix recvmmsg rtsan interceptor for glibc < 2.21 (#123664)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 10:54:53 PST 2025


Author: David CARLIER
Date: 2025-01-21T18:54:48Z
New Revision: a31e25396e8eca4eab2b5604912ad4c15496dc4a

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

LOG: [compiler-rt][rtsan] Fix recvmmsg rtsan interceptor for glibc < 2.21 (#123664)

linux/glibc prior to 2.21 had a different signature for recvmmsg.

Fix llvm#123484

Added: 
    

Modified: 
    compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
index 34c2d4cb37fd0c..2d8ab696835081 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
@@ -927,8 +927,13 @@ INTERCEPTOR(ssize_t, recvmsg, int socket, struct msghdr *message, int flags) {
 }
 
 #if SANITIZER_INTERCEPT_RECVMMSG
+#if defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ < 21
+INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message,
+            unsigned int len, int flags, const struct timespec *timeout) {
+#else
 INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message,
             unsigned int len, int flags, struct timespec *timeout) {
+#endif
   __rtsan_notify_intercepted_call("recvmmsg");
   return REAL(recvmmsg)(socket, message, len, flags, timeout);
 }


        


More information about the llvm-commits mailing list