/ xcconfig / Address Sanitizer.xcconfig
Address Sanitizer.xcconfig
 1  
 2  #include "Heimdal.xcconfig"
 3  
 4  ASAN_PATH = /usr/local/clang-asan
 5  
 6  BUILD_VARIANTS = normal asan
 7  
 8  CC         = $(ASAN_PATH)/bin/clang
 9  CXX        = $(ASAN_PATH)/bin/clang++
10  LDPLUSPLUS = $(ASAN_PATH)/bin/clang++
11  
12  // Xcode passes OTHER_LDFLAGS to libtool, which doesn't understand some of the
13  // flags. The libtool-wrap.py strips these flags out. <rdar://problem/4285249>
14  LIBTOOL = $(SOURCE_ROOT)/xcconfig/libtool-wrap.py
15  
16  // These are the default flags for enabling Address Sanitizer
17  ASAN_CFLAGS			= -fsanitize=address -fno-omit-frame-pointer
18  ASAN_LDFLAGS			= -fsanitize=address -Wl,-exported_symbol,___asan_mapping_offset -Wl,-exported_symbol,___asan_mapping_scale
19  
20  OTHER_CFLAGS_asan		= $(ASAN_CFLAGS) $(inherited)
21  OTHER_CPLUSPLUSFLAGS_asan	= $(ASAN_CFLAGS) $(inherited)
22  OTHER_LDFLAGS_asan		= $(ASAN_LDFLAGS) $(inherited)
23  
24  // Build optimized to reduce the performance impact
25  GCC_OPTIMIZATION_LEVEL = 1
26  
27  // Do not run the static analyzer, to speed up builds
28  RUN_CLANG_STATIC_ANALYZER = NO
29  
30  // Search for other Address Sanitizer-enabled frameworks in DSTROOT
31  FRAMEWORK_SEARCH_PATHS_asan = "$(DSTROOT)/System/Library/PrivateFrameworks" "$(DSTROOT)/System/Library/Frameworks" $(inherited)