summaryrefslogtreecommitdiffstats
path: root/clang/runtime/compiler-rt
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-03-20 23:49:07 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-03-20 23:49:07 +0000
commitcff3cde28bc322cc34e6200f990a2eb3e0ea729a (patch)
tree6a5a10afb2fb6c47ac080b3e777d4f2a9868893a /clang/runtime/compiler-rt
parent71738cafe6723a65a53180d8290885ba1fe87dce (diff)
downloadbcm5719-llvm-cff3cde28bc322cc34e6200f990a2eb3e0ea729a.tar.gz
bcm5719-llvm-cff3cde28bc322cc34e6200f990a2eb3e0ea729a.zip
Split ubsan runtime into three pieces (clang 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. This change also switches us to using -whole-archive for the ubsan runtime (which is made possible by the above split), and switches us to only linking the sanitizer runtime into the main binary and not into DSOs (which is made possible by using -whole-archive). The motivation for this is to only link a single copy of sanitizer_common into any binary. This is becoming important now because we want to share more state between multiple sanitizers in the same process (for instance, we want a single shared output mutex). The Darwin ubsan runtime is unchanged; because we use a DSO there, we don't need this complexity. llvm-svn: 177605
Diffstat (limited to 'clang/runtime/compiler-rt')
-rw-r--r--clang/runtime/compiler-rt/Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/runtime/compiler-rt/Makefile b/clang/runtime/compiler-rt/Makefile
index 2a2cd7b905c..e946de21a1d 100644
--- a/clang/runtime/compiler-rt/Makefile
+++ b/clang/runtime/compiler-rt/Makefile
@@ -99,13 +99,14 @@ TryCompile = \
# We currently only try to generate runtime libraries on x86.
ifeq ($(ARCH),x86)
RuntimeLibrary.linux.Configs += \
- full-i386.a profile-i386.a asan-i386.a ubsan-i386.a
+ full-i386.a profile-i386.a san-i386.a asan-i386.a ubsan-i386.a \
+ ubsan_cxx-i386.a
endif
ifeq ($(ARCH),x86_64)
RuntimeLibrary.linux.Configs += \
- full-x86_64.a profile-x86_64.a asan-x86_64.a tsan-x86_64.a msan-x86_64.a \
- ubsan-x86_64.a
+ full-x86_64.a profile-x86_64.a san-x86_64.a asan-x86_64.a \
+ tsan-x86_64.a msan-x86_64.a ubsan-x86_64.a ubsan_cxx-x86_64.a
# We need to build 32-bit ASan/UBsan libraries on 64-bit platform, and add them
# to the list of runtime libraries to make
# "clang -fsanitize=(address|undefined) -m32" work.
@@ -113,7 +114,8 @@ RuntimeLibrary.linux.Configs += \
# executable.
test_source = $(LLVM_SRC_ROOT)/tools/clang/runtime/compiler-rt/clang_linux_test_input.c
ifeq ($(call TryCompile,$(ToolDir)/clang,$(test_source),-m32),0)
-RuntimeLibrary.linux.Configs += asan-i386.a ubsan-i386.a
+RuntimeLibrary.linux.Configs += san-i386.a asan-i386.a ubsan-i386.a \
+ ubsan_cxx-i386.a
endif
ifneq ($(LLVM_ANDROID_TOOLCHAIN_DIR),)
RuntimeLibrary.linux.Configs += asan-arm-android.so
OpenPOWER on IntegriCloud