summaryrefslogtreecommitdiff
path: root/make/platform
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2013-11-15 13:13:01 +0000
committerAlexander Potapenko <glider@google.com>2013-11-15 13:13:01 +0000
commit8975fa7ba8b508ba2d56c75e4f910da78ad3eee4 (patch)
tree85aeefcce85e06891526ee693a397c0b9af54f39 /make/platform
parent106cb08a2457444e2d66404917ed3bd31b3c0726 (diff)
[ASan] Add the configure+make rules for building the ASan runtime for iOS simulator.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194813 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'make/platform')
-rw-r--r--make/platform/clang_darwin.mk30
1 files changed, 29 insertions, 1 deletions
diff --git a/make/platform/clang_darwin.mk b/make/platform/clang_darwin.mk
index 5f8801ce7..02f0a80fc 100644
--- a/make/platform/clang_darwin.mk
+++ b/make/platform/clang_darwin.mk
@@ -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)