[compiler-rt] e0e827c - [asan][Darwin] Use Apples blocks extension only when supported (#72639) (#72642)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 22:16:34 PST 2023


Author: Tobias Burnus
Date: 2023-12-06T22:16:30-08:00
New Revision: e0e827c9378c785a1005d2756181b9e572369bce

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

LOG: [asan][Darwin] Use Apples blocks extension only when supported (#72639) (#72642)

Issue #72639

The commit at 020cdaf broke build of asan on macOS with GCC. GCC does
not support the Apple blocks extension (yet). Uses of blocks in other
parts of the sanitisers are protected by MISSING_BLOCKS_SUPPORT. But the
type definition is not.

_This applies FX's patch from the issue._

Co-authored-by: FX Coudert <fxcoudert at gmail.com>

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/asan/asan_mac.cpp b/compiler-rt/lib/asan/asan_mac.cpp
index 5d5146e0cde0b..1b0e9b3fe0060 100644
--- a/compiler-rt/lib/asan/asan_mac.cpp
+++ b/compiler-rt/lib/asan/asan_mac.cpp
@@ -139,9 +139,11 @@ typedef void (*dispatch_mach_handler_function_t)(void *context,
                                                  dispatch_mach_reason reason,
                                                  dispatch_mach_msg_t message,
                                                  mach_error_t error);
+#  if !defined(MISSING_BLOCKS_SUPPORT)
 typedef void (^dispatch_mach_handler_t)(dispatch_mach_reason reason,
                                         dispatch_mach_msg_t message,
                                         mach_error_t error);
+#  endif
 
 // A wrapper for the ObjC blocks used to support libdispatch.
 typedef struct {


        


More information about the llvm-commits mailing list