summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-11-15 12:40:37 +0000
committerAlexey Samsonov <samsonov@google.com>2012-11-15 12:40:37 +0000
commite0d80f1852bff0bcf8f71b73773cdff71bc94f33 (patch)
tree70378c388d5f424dbcf81cd6309e7c61948b0d17 /runtime
parent621ba4f0dba0accdf67fb38e98bbe14db22ddf8e (diff)
downloadclang-e0d80f1852bff0bcf8f71b73773cdff71bc94f33.tar.gz
clang-e0d80f1852bff0bcf8f71b73773cdff71bc94f33.tar.bz2
clang-e0d80f1852bff0bcf8f71b73773cdff71bc94f33.tar.xz
[UBSan] Add support for building ubsan runtime library on Linux with 'make'. Clang part.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168039 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime')
-rw-r--r--runtime/compiler-rt/Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/compiler-rt/Makefile b/runtime/compiler-rt/Makefile
index 68b2941f87..3475d24e9b 100644
--- a/runtime/compiler-rt/Makefile
+++ b/runtime/compiler-rt/Makefile
@@ -98,19 +98,20 @@ 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
+ full-i386.a profile-i386.a asan-i386.a ubsan-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
-# We need to build 32-bit ASan library on 64-bit platform, and add it to the
-# list of runtime libraries to make "clang -faddress-sanitizer -m32" work.
+ full-x86_64.a profile-x86_64.a asan-x86_64.a tsan-x86_64.a ubsan-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.
# We check that Clang can produce working 32-bit binaries by compiling a simple
# 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
+RuntimeLibrary.linux.Configs += asan-i386.a ubsan-i386.a
endif
ifneq ($(LLVM_ANDROID_TOOLCHAIN_DIR),)
RuntimeLibrary.linux.Configs += asan-arm-android.so