platform/clang_darwin: Add asan runtime library configuration.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@145649 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/make/platform/clang_darwin.mk b/make/platform/clang_darwin.mk
index 76d127d..05014b9 100644
--- a/make/platform/clang_darwin.mk
+++ b/make/platform/clang_darwin.mk
@@ -60,6 +60,12 @@
Configs += profile_ios
UniversalArchs.profile_ios := $(call CheckArches,i386 x86_64 armv6 armv7)
+# Configurations which define the ASAN support functions.
+#
+# Note that ASAN doesn't appear to currently support i386.
+Configs += asan_osx
+UniversalArchs.asan_osx := $(call CheckArches,x86_64)
+
# If RC_SUPPORTED_ARCHS is defined, treat it as a list of the architectures we
# are intended to support and limit what we try to build to that.
#
@@ -96,6 +102,14 @@
CFLAGS.eprintf := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.10.4 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
+# FIXME: We can't build ASAN with our stub SDK yet.
+CFLAGS.asan_osx := $(CFLAGS) -mmacosx-version-min=10.4
+CFLAGS.asan_osx += \
+ -DASAN_USE_SYSINFO=1 \
+ -DASAN_NEEDS_SEGV=1 \
+ -DASAN_HAS_EXCEPTIONS=1 \
+ -DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 \
+
CFLAGS.ios.i386 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
CFLAGS.ios.x86_64 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
CFLAGS.ios.armv6 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
@@ -132,6 +146,8 @@
FUNCTIONS.profile_osx := GCDAProfiling
FUNCTIONS.profile_ios := GCDAProfiling
+FUNCTIONS.asan_osx := $(AsanFunctions)
+
CCKEXT_COMMON_FUNCTIONS := \
absvdi2 \
absvsi2 \