[ASan] Do not build the interceptors that use ObjC blocks if the compiler does not...
authorAlexander Potapenko <glider@google.com>
Tue, 4 Dec 2012 02:41:47 +0000 (02:41 +0000)
committerAlexander Potapenko <glider@google.com>
Tue, 4 Dec 2012 02:41:47 +0000 (02:41 +0000)
Need to define MISSING_BLOCKS_SUPPORT in this case at buildtime.

Patch by Jack Howarth <howarth@bromo.med.uc.edu>

llvm-svn: 169206

compiler-rt/lib/asan/asan_intercepted_functions.h
compiler-rt/lib/asan/asan_mac.cc
compiler-rt/lib/asan/dynamic/asan_interceptors_dynamic.cc

index 5abc3f4..06d7577 100644 (file)
@@ -205,7 +205,7 @@ DECLARE_FUNCTION_AND_WRAPPER(void, __CFInitialize, void);
 DECLARE_FUNCTION_AND_WRAPPER(CFStringRef, CFStringCreateCopy,
                              CFAllocatorRef alloc, CFStringRef str);
 DECLARE_FUNCTION_AND_WRAPPER(void, free, void* ptr);
-#if MAC_INTERPOSE_FUNCTIONS
+#if MAC_INTERPOSE_FUNCTIONS && !defined(MISSING_BLOCKS_SUPPORT)
 DECLARE_FUNCTION_AND_WRAPPER(void, dispatch_group_async,
                              dispatch_group_t dg,
                              dispatch_queue_t dq, void (^work)(void));
index fe87843..7abe9a4 100644 (file)
@@ -385,7 +385,7 @@ INTERCEPTOR(void, dispatch_group_async_f, dispatch_group_t group,
                                asan_dispatch_call_block_and_release);
 }
 
-#if MAC_INTERPOSE_FUNCTIONS
+#if MAC_INTERPOSE_FUNCTIONS && !defined(MISSING_BLOCKS_SUPPORT)
 // dispatch_async, dispatch_group_async and others tailcall the corresponding
 // dispatch_*_f functions. When wrapping functions with mach_override, those
 // dispatch_*_f are intercepted automatically. But with dylib interposition
index df625b0..4f0f7bd 100644 (file)
@@ -91,13 +91,13 @@ const interpose_substitution substitutions[]
   INTERPOSE_FUNCTION(dispatch_after_f),
   INTERPOSE_FUNCTION(dispatch_barrier_async_f),
   INTERPOSE_FUNCTION(dispatch_group_async_f),
-
+#ifndef MISSING_BLOCKS_SUPPORT
   INTERPOSE_FUNCTION(dispatch_group_async),
   INTERPOSE_FUNCTION(dispatch_async),
   INTERPOSE_FUNCTION(dispatch_after),
   INTERPOSE_FUNCTION(dispatch_source_set_event_handler),
   INTERPOSE_FUNCTION(dispatch_source_set_cancel_handler),
-
+#endif
   INTERPOSE_FUNCTION(signal),
   INTERPOSE_FUNCTION(sigaction),