From: Alexander Potapenko Date: Tue, 4 Dec 2012 02:41:47 +0000 (+0000) Subject: [ASan] Do not build the interceptors that use ObjC blocks if the compiler does not... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0dcd6d94687ae1edff04258042b00334bf159413;p=platform%2Fupstream%2Fllvm.git [ASan] Do not build the interceptors that use ObjC blocks if the compiler does not support blocks. Need to define MISSING_BLOCKS_SUPPORT in this case at buildtime. Patch by Jack Howarth llvm-svn: 169206 --- diff --git a/compiler-rt/lib/asan/asan_intercepted_functions.h b/compiler-rt/lib/asan/asan_intercepted_functions.h index 5abc3f4..06d7577fc 100644 --- a/compiler-rt/lib/asan/asan_intercepted_functions.h +++ b/compiler-rt/lib/asan/asan_intercepted_functions.h @@ -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)); diff --git a/compiler-rt/lib/asan/asan_mac.cc b/compiler-rt/lib/asan/asan_mac.cc index fe87843..7abe9a4 100644 --- a/compiler-rt/lib/asan/asan_mac.cc +++ b/compiler-rt/lib/asan/asan_mac.cc @@ -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 diff --git a/compiler-rt/lib/asan/dynamic/asan_interceptors_dynamic.cc b/compiler-rt/lib/asan/dynamic/asan_interceptors_dynamic.cc index df625b0..4f0f7bd 100644 --- a/compiler-rt/lib/asan/dynamic/asan_interceptors_dynamic.cc +++ b/compiler-rt/lib/asan/dynamic/asan_interceptors_dynamic.cc @@ -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),