[ASan] Add the configure+make rules for building the ASan runtime for iOS simulator.

llvm-svn: 194813
This commit is contained in:
Alexander Potapenko 2013-11-15 13:13:01 +00:00
parent fb9bd75370
commit bf50fbfc21

View File

@ -30,7 +30,11 @@ XCRun = \
result=`xcrun -find $(1) 2> /dev/null`; \
if [ "$$?" != "0" ]; then result=$(1); fi; \
echo $$result)
XCRunSdkPath = \
$(shell \
result=`xcrun --sdk $(1) --show-sdk-path 2> /dev/null`; \
if [ "$$?" != "0" ]; then result=""; fi; \
echo $$result)
###
CC := $(call XCRun,clang)
@ -84,6 +88,9 @@ UniversalArchs.profile_ios := $(call CheckArches,i386 x86_64 armv7,profile_ios)
Configs += asan_osx_dynamic
UniversalArchs.asan_osx_dynamic := $(call CheckArches,i386 x86_64,asan_osx_dynamic)
Configs += asan_iossim_dynamic
UniversalArchs.asan_iossim_dynamic := $(call CheckArches,i386 x86_64,asan_iossim_dynamic)
Configs += ubsan_osx
UniversalArchs.ubsan_osx := $(call CheckArches,i386 x86_64,ubsan_osx)
@ -143,6 +150,15 @@ CFLAGS.asan_osx_dynamic := \
-DMAC_INTERPOSE_FUNCTIONS=1 \
-DASAN_FLEXIBLE_MAPPING_AND_OFFSET=1
IOSSIM_SDK_PATH := $(call XCRunSdkPath,iphonesimulator)
CFLAGS.asan_iossim_dynamic := \
$(CFLAGS) -mios-simulator-version-min=7.0 \
-isysroot $(IOSSIM_SDK_PATH) \
-fno-builtin \
-gline-tables-only \
-DMAC_INTERPOSE_FUNCTIONS=1 \
-DASAN_FLEXIBLE_MAPPING_AND_OFFSET=1
CFLAGS.ubsan_osx := $(CFLAGS) -mmacosx-version-min=10.6 -fno-builtin
CFLAGS.ios.i386 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
@ -176,6 +192,14 @@ CFLAGS.profile_ios.armv7s := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
SHARED_LIBRARY.asan_osx_dynamic := 1
LDFLAGS.asan_osx_dynamic := -lstdc++ -undefined dynamic_lookup
# Configure the asan_iossim_dynamic library to be built shared.
SHARED_LIBRARY.asan_iossim_dynamic := 1
# configure+make uses Clang, so we're using isysroot instead of --sysroot
# or -Wl,-syslibroot.
LDFLAGS.asan_iossim_dynamic := -undefined dynamic_lookup \
-Wl,-ios_simulator_version_min,7.0.0 \
-mios-simulator-version-min=7.0 -isysroot $(IOSSIM_SDK_PATH)
FUNCTIONS.eprintf := eprintf
FUNCTIONS.10.4 := eprintf floatundidf floatundisf floatundixf
@ -195,6 +219,10 @@ FUNCTIONS.asan_osx_dynamic := $(AsanFunctions) $(InterceptionFunctions) \
$(SanitizerCommonFunctions) \
$(AsanDynamicFunctions)
FUNCTIONS.asan_iossim_dynamic := $(AsanFunctions) $(InterceptionFunctions) \
$(SanitizerCommonFunctions) \
$(AsanDynamicFunctions)
FUNCTIONS.ubsan_osx := $(UbsanFunctions) $(UbsanCXXFunctions) \
$(SanitizerCommonFunctions)