aboutsummaryrefslogtreecommitdiff
path: root/make/platform
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2012-07-30 10:58:13 +0000
committerAndrew Turner <andrew@FreeBSD.org>2012-07-30 10:58:13 +0000
commit37dfff057418e02f8e5322da12684dd927e3d881 (patch)
tree40cc44a3d02ed86de24f2117a55680e4f0eb01a0 /make/platform
parent864a7b98b54e1f984c248f3be83dfcc082a382ea (diff)
downloadsrc-37dfff057418e02f8e5322da12684dd927e3d881.tar.gz
src-37dfff057418e02f8e5322da12684dd927e3d881.zip
Import compiler-rt r160957.vendor/compiler-rt/compiler-rt-r160957
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=238901 svn path=/vendor/compiler-rt/compiler-rt-r160957/; revision=238902; tag=vendor/compiler-rt/compiler-rt-r160957
Diffstat (limited to 'make/platform')
-rw-r--r--make/platform/clang_darwin.mk99
-rw-r--r--make/platform/clang_linux.mk19
2 files changed, 29 insertions, 89 deletions
diff --git a/make/platform/clang_darwin.mk b/make/platform/clang_darwin.mk
index bb8bf78a0873..d1788c44903a 100644
--- a/make/platform/clang_darwin.mk
+++ b/make/platform/clang_darwin.mk
@@ -13,9 +13,14 @@ CheckArches = \
result=""; \
for arch in $(1); do \
if $(CC) -arch $$arch -c \
+ -integrated-as \
$(ProjSrcRoot)/make/platform/clang_darwin_test_input.c \
+ -isysroot $(ProjSrcRoot)/SDKs/darwin \
-o /dev/null > /dev/null 2> /dev/null; then \
result="$$result$$arch "; \
+ else \
+ printf 1>&2 \
+ "warning: clang_darwin.mk: dropping arch '$$arch' from lib '$(2)'\n"; \
fi; \
done; \
echo $$result)
@@ -31,40 +36,30 @@ UniversalArchs :=
# still be referenced from Darwin system headers. This symbol is only ever
# needed on i386.
Configs += eprintf
-UniversalArchs.eprintf := $(call CheckArches,i386)
+UniversalArchs.eprintf := $(call CheckArches,i386,eprintf)
# Configuration for targetting 10.4. We need a few functions missing from
# libgcc_s.10.4.dylib. We only build x86 slices since clang doesn't really
# support targetting PowerPC.
Configs += 10.4
-UniversalArchs.10.4 := $(call CheckArches,i386 x86_64)
-
-# Configuration for targetting iOS, for some ARMv6 functions, which must be
-# in the same linkage unit, and for a couple of other functions that didn't
-# make it into libSystem.
-Configs += ios
-UniversalArchs.ios := $(call CheckArches,i386 x86_64 armv6 armv7)
+UniversalArchs.10.4 := $(call CheckArches,i386 x86_64,10.4)
# Configuration for targetting OSX. These functions may not be in libSystem
# so we should provide our own.
Configs += osx
-UniversalArchs.osx := $(call CheckArches,i386 x86_64)
+UniversalArchs.osx := $(call CheckArches,i386 x86_64,osx)
# Configuration for use with kernel/kexts.
Configs += cc_kext
-UniversalArchs.cc_kext := $(call CheckArches,armv6 armv7 i386 x86_64)
+UniversalArchs.cc_kext := $(call CheckArches,i386 x86_64,cc_kext)
# Configurations which define the profiling support functions.
Configs += profile_osx
-UniversalArchs.profile_osx := $(call CheckArches,i386 x86_64)
-Configs += profile_ios
-UniversalArchs.profile_ios := $(call CheckArches,i386 x86_64 armv6 armv7)
+UniversalArchs.profile_osx := $(call CheckArches,i386 x86_64,profile_osx)
# 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,i386 x86_64)
+UniversalArchs.asan_osx := $(call CheckArches,i386 x86_64,asan_osx)
# 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.
@@ -92,56 +87,31 @@ CFLAGS := -Wall -Werror -O3 -fomit-frame-pointer
# supported deployment target -- nothing in the compiler-rt libraries should
# actually depend on the deployment target.
OSX_DEPLOYMENT_ARGS := -mmacosx-version-min=10.4
-IOS_DEPLOYMENT_ARGS := -miphoneos-version-min=1.0
-IOSSIM_DEPLOYMENT_ARGS := -miphoneos-version-min=1.0
# Use our stub SDK as the sysroot to support more portable building.
OSX_DEPLOYMENT_ARGS += -isysroot $(ProjSrcRoot)/SDKs/darwin
-IOS_DEPLOYMENT_ARGS += -isysroot $(ProjSrcRoot)/SDKs/darwin
-IOSSIM_DEPLOYMENT_ARGS += -isysroot $(ProjSrcRoot)/SDKs/darwin
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.5
+CFLAGS.asan_osx := $(CFLAGS) -mmacosx-version-min=10.5 -fno-builtin
-CFLAGS.ios.i386 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
-CFLAGS.ios.x86_64 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
-CFLAGS.ios.armv6 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
-CFLAGS.ios.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
CFLAGS.osx.i386 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.osx.x86_64 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.cc_kext.i386 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.cc_kext.x86_64 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
-CFLAGS.cc_kext.armv6 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) -mthumb
-CFLAGS.cc_kext.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
CFLAGS.profile_osx.i386 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.profile_osx.x86_64 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
-CFLAGS.profile_ios.i386 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
-CFLAGS.profile_ios.x86_64 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
-CFLAGS.profile_ios.armv6 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
-CFLAGS.profile_ios.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
FUNCTIONS.eprintf := eprintf
FUNCTIONS.10.4 := eprintf floatundidf floatundisf floatundixf
-FUNCTIONS.ios := divmodsi4 udivmodsi4 mulosi4 mulodi4 muloti4
-# On x86, the divmod functions reference divsi.
-FUNCTIONS.ios.i386 := $(FUNCTIONS.ios) \
- divsi3 udivsi3
-FUNCTIONS.ios.x86_64 := $(FUNCTIONS.ios) \
- divsi3 udivsi3
-FUNCTIONS.ios.armv6 := $(FUNCTIONS.ios) \
- sync_synchronize \
- switch16 switch32 switch8 switchu8 \
- save_vfp_d8_d15_regs restore_vfp_d8_d15_regs
-
FUNCTIONS.osx := mulosi4 mulodi4 muloti4
FUNCTIONS.profile_osx := GCDAProfiling
-FUNCTIONS.profile_ios := GCDAProfiling
-FUNCTIONS.asan_osx := $(AsanFunctions)
+FUNCTIONS.asan_osx := $(AsanFunctions) $(InterceptionFunctions) \
+ $(SanitizerCommonFunctions)
CCKEXT_COMMON_FUNCTIONS := \
absvdi2 \
@@ -254,43 +224,6 @@ CCKEXT_ARM_FUNCTIONS := $(CCKEXT_COMMON_FUNCTIONS) \
unorddf2 \
unordsf2
-CCKEXT_ARMVFP_FUNCTIONS := $(CCKEXT_ARM_FUNCTIONS) \
- adddf3vfp \
- addsf3vfp \
- divdf3vfp \
- divsf3vfp \
- eqdf2vfp \
- eqsf2vfp \
- extendsfdf2vfp \
- fixdfsivfp \
- fixsfsivfp \
- fixunsdfsivfp \
- fixunssfsivfp \
- floatsidfvfp \
- floatsisfvfp \
- floatunssidfvfp \
- floatunssisfvfp \
- gedf2vfp \
- gesf2vfp \
- gtdf2vfp \
- gtsf2vfp \
- ledf2vfp \
- lesf2vfp \
- ltdf2vfp \
- ltsf2vfp \
- muldf3vfp \
- mulsf3vfp \
- nedf2vfp \
- nesf2vfp \
- subdf3vfp \
- subsf3vfp \
- truncdfsf2vfp \
- unorddf2vfp \
- unordsf2vfp
-
-FUNCTIONS.cc_kext.armv6 := $(CCKEXT_ARMVFP_FUNCTIONS)
-FUNCTIONS.cc_kext.armv7 := $(CCKEXT_ARMVFP_FUNCTIONS)
-
CCKEXT_X86_FUNCTIONS := $(CCKEXT_COMMON_FUNCTIONS) \
divxc3 \
fixunsxfdi \
@@ -364,10 +297,6 @@ CCKEXT_MISSING_FUNCTIONS := \
aeabi_fcmpge aeabi_fcmpgt aeabi_fcmple aeabi_fcmplt aeabi_frsub aeabi_idivmod \
aeabi_uidivmod
-FUNCTIONS.cc_kext.armv6 := \
- $(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.armv6))
-FUNCTIONS.cc_kext.armv7 := \
- $(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.armv7))
FUNCTIONS.cc_kext.i386 := \
$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.i386))
FUNCTIONS.cc_kext.x86_64 := \
diff --git a/make/platform/clang_linux.mk b/make/platform/clang_linux.mk
index b3a77593a1ef..f2b049f8c931 100644
--- a/make/platform/clang_linux.mk
+++ b/make/platform/clang_linux.mk
@@ -47,6 +47,12 @@ Configs += asan-x86_64
Arch.asan-x86_64 := x86_64
endif
+# Configuration for TSAN runtime.
+ifeq ($(CompilerTargetArch),x86_64)
+Configs += tsan-x86_64
+Arch.tsan-x86_64 := x86_64
+endif
+
endif
###
@@ -57,8 +63,9 @@ CFLAGS.full-i386 := $(CFLAGS) -m32
CFLAGS.full-x86_64 := $(CFLAGS) -m64
CFLAGS.profile-i386 := $(CFLAGS) -m32
CFLAGS.profile-x86_64 := $(CFLAGS) -m64
-CFLAGS.asan-i386 := $(CFLAGS) -m32
-CFLAGS.asan-x86_64 := $(CFLAGS) -m64
+CFLAGS.asan-i386 := $(CFLAGS) -m32 -fPIE -fno-builtin
+CFLAGS.asan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin
+CFLAGS.tsan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin
# Use our stub SDK as the sysroot to support more portable building. For now we
# just do this for the non-ASAN modules, because the stub SDK doesn't have
@@ -72,8 +79,12 @@ FUNCTIONS.full-i386 := $(CommonFunctions) $(ArchFunctions.i386)
FUNCTIONS.full-x86_64 := $(CommonFunctions) $(ArchFunctions.x86_64)
FUNCTIONS.profile-i386 := GCDAProfiling
FUNCTIONS.profile-x86_64 := GCDAProfiling
-FUNCTIONS.asan-i386 := $(AsanFunctions)
-FUNCTIONS.asan-x86_64 := $(AsanFunctions)
+FUNCTIONS.asan-i386 := $(AsanFunctions) $(InterceptionFunctions) \
+ $(SanitizerCommonFunctions)
+FUNCTIONS.asan-x86_64 := $(AsanFunctions) $(InterceptionFunctions) \
+ $(SanitizerCommonFunctions)
+FUNCTIONS.tsan-x86_64 := $(TsanFunctions) $(InterceptionFunctions) \
+ $(SanitizerCommonFunctions)
# Always use optimized variants.
OPTIMIZED := 1