summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-03-20 23:49:17 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-03-20 23:49:17 +0000
commit3e587a4f631c1b7338d4f2a29df74b704b8bb1ca (patch)
treec0b0cf95f41a5813e7c53ad12ce714172dfda953 /make
parentedcb288a81c4e6abd6537342295750d9d1223349 (diff)
Split ubsan runtime into three pieces (compiler-rt part):
* libclang_rt-san-* is sanitizer_common, and is linked in only if no other sanitizer runtime is present. * libclang_rt-ubsan-* is the piece of the runtime which doesn't depend on a C++ ABI library, and is always linked in. * libclang_rt-ubsan_cxx-* is the piece of the runtime which depends on a C++ ABI library, and is only linked in when linking a C++ binary. The Darwin ubsan runtime is unchanged. For more details, see Clang change r177605. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'make')
-rw-r--r--make/platform/clang_linux.mk26
1 files changed, 19 insertions, 7 deletions
diff --git a/make/platform/clang_linux.mk b/make/platform/clang_linux.mk
index d3ddc7138..441ad7912 100644
--- a/make/platform/clang_linux.mk
+++ b/make/platform/clang_linux.mk
@@ -51,23 +51,27 @@ endif
# Build runtime libraries for i386.
ifeq ($(call contains,$(SupportedArches),i386),true)
-Configs += full-i386 profile-i386 asan-i386 ubsan-i386
+Configs += full-i386 profile-i386 san-i386 asan-i386 ubsan-i386 ubsan_cxx-i386
Arch.full-i386 := i386
Arch.profile-i386 := i386
+Arch.san-i386 := i386
Arch.asan-i386 := i386
Arch.ubsan-i386 := i386
+Arch.ubsan_cxx-i386 := i386
endif
# Build runtime libraries for x86_64.
ifeq ($(call contains,$(SupportedArches),x86_64),true)
-Configs += full-x86_64 profile-x86_64 asan-x86_64 tsan-x86_64 msan-x86_64 \
- ubsan-x86_64
+Configs += full-x86_64 profile-x86_64 san-x86_64 asan-x86_64 tsan-x86_64 \
+ msan-x86_64 ubsan-x86_64 ubsan_cxx-x86_64
Arch.full-x86_64 := x86_64
Arch.profile-x86_64 := x86_64
+Arch.san-x86_64 := x86_64
Arch.asan-x86_64 := x86_64
Arch.tsan-x86_64 := x86_64
Arch.msan-x86_64 := x86_64
Arch.ubsan-x86_64 := x86_64
+Arch.ubsan_cxx-x86_64 := x86_64
endif
ifneq ($(LLVM_ANDROID_TOOLCHAIN_DIR),)
@@ -86,14 +90,18 @@ CFLAGS.full-i386 := $(CFLAGS) -m32
CFLAGS.full-x86_64 := $(CFLAGS) -m64
CFLAGS.profile-i386 := $(CFLAGS) -m32
CFLAGS.profile-x86_64 := $(CFLAGS) -m64
+CFLAGS.san-i386 := $(CFLAGS) -m32 -fPIE -fno-builtin -fno-rtti
+CFLAGS.san-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin -fno-rtti
CFLAGS.asan-i386 := $(CFLAGS) -m32 -fPIE -fno-builtin -fno-rtti \
-DASAN_FLEXIBLE_MAPPING_AND_OFFSET=1
CFLAGS.asan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin -fno-rtti \
-DASAN_FLEXIBLE_MAPPING_AND_OFFSET=1
CFLAGS.tsan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin -fno-rtti
CFLAGS.msan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin -fno-rtti
-CFLAGS.ubsan-i386 := $(CFLAGS) -m32 -fPIE -fno-builtin
-CFLAGS.ubsan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin
+CFLAGS.ubsan-i386 := $(CFLAGS) -m32 -fPIE -fno-builtin -fno-rtti
+CFLAGS.ubsan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin -fno-rtti
+CFLAGS.ubsan_cxx-i386 := $(CFLAGS) -m32 -fPIE -fno-builtin
+CFLAGS.ubsan_cxx-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin
SHARED_LIBRARY.asan-arm-android := 1
ANDROID_COMMON_FLAGS := -target arm-linux-androideabi \
@@ -116,6 +124,8 @@ FUNCTIONS.full-i386 := $(CommonFunctions) $(ArchFunctions.i386)
FUNCTIONS.full-x86_64 := $(CommonFunctions) $(ArchFunctions.x86_64)
FUNCTIONS.profile-i386 := GCDAProfiling
FUNCTIONS.profile-x86_64 := GCDAProfiling
+FUNCTIONS.san-i386 := $(SanitizerCommonFunctions)
+FUNCTIONS.san-x86_64 := $(SanitizerCommonFunctions)
FUNCTIONS.asan-i386 := $(AsanFunctions) $(InterceptionFunctions) \
$(SanitizerCommonFunctions)
FUNCTIONS.asan-x86_64 := $(AsanFunctions) $(InterceptionFunctions) \
@@ -126,8 +136,10 @@ FUNCTIONS.tsan-x86_64 := $(TsanFunctions) $(InterceptionFunctions) \
$(SanitizerCommonFunctions)
FUNCTIONS.msan-x86_64 := $(MsanFunctions) $(InterceptionFunctions) \
$(SanitizerCommonFunctions)
-FUNCTIONS.ubsan-i386 := $(UbsanFunctions) $(SanitizerCommonFunctions)
-FUNCTIONS.ubsan-x86_64 := $(UbsanFunctions) $(SanitizerCommonFunctions)
+FUNCTIONS.ubsan-i386 := $(UbsanFunctions)
+FUNCTIONS.ubsan-x86_64 := $(UbsanFunctions)
+FUNCTIONS.ubsan_cxx-i386 := $(UbsanCXXFunctions)
+FUNCTIONS.ubsan_cxx-x86_64 := $(UbsanCXXFunctions)
# Always use optimized variants.
OPTIMIZED := 1