Skip to content

Commit cc9ffd1

Browse files
author
Alexey Samsonov
committed
[UBSan] Add support for building ubsan runtime library on Linux with 'make'. Clang part.
llvm-svn: 168039
1 parent 11aec95 commit cc9ffd1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clang/runtime/compiler-rt/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,20 @@ TryCompile = \
9898
# We currently only try to generate runtime libraries on x86.
9999
ifeq ($(ARCH),x86)
100100
RuntimeLibrary.linux.Configs += \
101-
full-i386.a profile-i386.a asan-i386.a
101+
full-i386.a profile-i386.a asan-i386.a ubsan-i386.a
102102
endif
103103

104104
ifeq ($(ARCH),x86_64)
105105
RuntimeLibrary.linux.Configs += \
106-
full-x86_64.a profile-x86_64.a asan-x86_64.a tsan-x86_64.a
107-
# We need to build 32-bit ASan library on 64-bit platform, and add it to the
108-
# list of runtime libraries to make "clang -faddress-sanitizer -m32" work.
106+
full-x86_64.a profile-x86_64.a asan-x86_64.a tsan-x86_64.a ubsan-x86_64.a
107+
# We need to build 32-bit ASan/UBsan libraries on 64-bit platform, and add them
108+
# to the list of runtime libraries to make
109+
# "clang -fsanitize=(address|undefined) -m32" work.
109110
# We check that Clang can produce working 32-bit binaries by compiling a simple
110111
# executable.
111112
test_source = $(LLVM_SRC_ROOT)/tools/clang/runtime/compiler-rt/clang_linux_test_input.c
112113
ifeq ($(call TryCompile,$(ToolDir)/clang,$(test_source),-m32),0)
113-
RuntimeLibrary.linux.Configs += asan-i386.a
114+
RuntimeLibrary.linux.Configs += asan-i386.a ubsan-i386.a
114115
endif
115116
ifneq ($(LLVM_ANDROID_TOOLCHAIN_DIR),)
116117
RuntimeLibrary.linux.Configs += asan-arm-android.so

0 commit comments

Comments
 (0)