[compiler-rt] 5d4f644 - [asan] Fix Darwin runtimes compilation

Shoaib Meenai via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 1 02:23:53 PDT 2023


Author: Shoaib Meenai
Date: 2023-04-01T02:22:17-07:00
New Revision: 5d4f644b33006fe4e97239cc04e2a010239981e6

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

LOG: [asan] Fix Darwin runtimes compilation

It was failing because of size_t being unknown. I was going to just pull
in stddef.h, but the callback using size_t is only used for Linux and
NetBSD, so limit its definition to those platforms as well.

Added: 
    

Modified: 
    compiler-rt/lib/asan/asan_memory_profile.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/asan/asan_memory_profile.cpp b/compiler-rt/lib/asan/asan_memory_profile.cpp
index c7e3d7ba0f9a..f41d8e1926b4 100644
--- a/compiler-rt/lib/asan/asan_memory_profile.cpp
+++ b/compiler-rt/lib/asan/asan_memory_profile.cpp
@@ -128,12 +128,14 @@ static void LockDefStuffAndStopTheWorld(DoStopTheWorldParam *param) {
   __lsan::UnlockThreadRegistry();
 }
 
+#if SANITIZER_LINUX || SANITIZER_NETBSD
 static int LockStuffAndStopTheWorldCallback(struct dl_phdr_info *info,
                                             size_t size, void *data) {
   DoStopTheWorldParam *param = reinterpret_cast<DoStopTheWorldParam *>(data);
   LockDefStuffAndStopTheWorld(param);
   return 1;
 }
+#endif
 
 static void LockStuffAndStopTheWorld(StopTheWorldCallback callback,
                                      void *argument) {


        


More information about the llvm-commits mailing list