summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2015-02-18 22:26:49 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2015-02-18 22:26:49 +0000
commitbdc0e9eb245f5d3afc91e21ad9669183b17317eb (patch)
tree7b49ff28ebf0bd3450bb0e8925926d3ed56e83b9
parent3310b9db3b65683388142c3ec0b736a505f9e2d9 (diff)
Remove support for building sanitizers from Makefile/autoconf build on Linux.
This is a re-application of r229554 restricted to Linux build only. Apple still uses Makefile/autoconf to build Clang and sanitizers. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229756 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Makefile.mk3
-rw-r--r--lib/asan/README.txt14
-rw-r--r--lib/dfsan/Makefile.mk23
-rw-r--r--lib/lsan/Makefile.mk3
-rw-r--r--lib/msan/Makefile.mk24
-rw-r--r--lib/tsan/Makefile.mk18
-rw-r--r--lib/tsan/rtl/Makefile.mk25
-rw-r--r--make/platform/clang_linux.mk75
8 files changed, 9 insertions, 176 deletions
diff --git a/lib/Makefile.mk b/lib/Makefile.mk
index ed9690d46..7eb6489fe 100644
--- a/lib/Makefile.mk
+++ b/lib/Makefile.mk
@@ -12,11 +12,8 @@ SubDirs :=
# Add submodules.
SubDirs += asan
SubDirs += builtins
-SubDirs += dfsan
SubDirs += interception
SubDirs += lsan
-SubDirs += msan
SubDirs += profile
SubDirs += sanitizer_common
-SubDirs += tsan
SubDirs += ubsan
diff --git a/lib/asan/README.txt b/lib/asan/README.txt
index b9c43acd5..8cc9bb17b 100644
--- a/lib/asan/README.txt
+++ b/lib/asan/README.txt
@@ -1,7 +1,6 @@
AddressSanitizer RT
================================
-This directory contains sources of the AddressSanitizer (asan) runtime library.
-We are in the process of integrating AddressSanitizer with LLVM, stay tuned.
+This directory contains sources of the AddressSanitizer (ASan) runtime library.
Directory structure:
README.txt : This file.
@@ -13,14 +12,13 @@ tests/* : ASan unit tests.
Also ASan runtime needs the following libraries:
lib/interception/ : Machinery used to intercept function calls.
-lib/sanitizer_common/ : Code shared between ASan and TSan.
+lib/sanitizer_common/ : Code shared between various sanitizers.
-Currently ASan runtime can be built by both make and cmake build systems.
-(see compiler-rt/make and files Makefile.mk for make-based build and
-files CMakeLists.txt for cmake-based build).
+ASan runtime currently also embeds part of LeakSanitizer runtime for
+leak detection (lib/lsan/lsan_common.{cc,h}).
-ASan unit and output tests work only with cmake. You may run this
-command from the root of your cmake build tree:
+ASan runtime can only be built by CMake. You can run ASan tests
+from the root of your CMake build tree:
make check-asan
diff --git a/lib/dfsan/Makefile.mk b/lib/dfsan/Makefile.mk
deleted file mode 100644
index 4aeaac42d..000000000
--- a/lib/dfsan/Makefile.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#===- lib/dfsan/Makefile.mk --------------------------------*- Makefile -*--===#
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-#===------------------------------------------------------------------------===#
-
-ModuleName := dfsan
-SubDirs :=
-
-Sources := $(foreach file,$(wildcard $(Dir)/*.cc),$(notdir $(file)))
-ObjNames := $(Sources:%.cc=%.o)
-
-Implementation := Generic
-
-# FIXME: use automatic dependencies?
-Dependencies := $(wildcard $(Dir)/*.h)
-Dependencies += $(wildcard $(Dir)/../sanitizer_common/*.h)
-
-# Define a convenience variable for all the dfsan functions.
-DfsanFunctions := $(Sources:%.cc=%)
diff --git a/lib/lsan/Makefile.mk b/lib/lsan/Makefile.mk
index 2a6b41c98..5e70634e7 100644
--- a/lib/lsan/Makefile.mk
+++ b/lib/lsan/Makefile.mk
@@ -20,9 +20,6 @@ Dependencies := $(wildcard $(Dir)/*.h)
Dependencies += $(wildcard $(Dir)/../interception/*.h)
Dependencies += $(wildcard $(Dir)/../sanitizer_common/*.h)
-# Define a convenience variable for all the lsan functions.
-LsanFunctions := $(Sources:%.cc=%)
-
# lsan functions used in another sanitizers.
LsanCommonSources := $(foreach file,$(wildcard $(Dir)/lsan_common*.cc),$(notdir $(file)))
LsanCommonFunctions := $(LsanCommonSources:%.cc=%)
diff --git a/lib/msan/Makefile.mk b/lib/msan/Makefile.mk
deleted file mode 100644
index 99e3b036e..000000000
--- a/lib/msan/Makefile.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-#===- lib/msan/Makefile.mk ---------------------------------*- Makefile -*--===#
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-#===------------------------------------------------------------------------===#
-
-ModuleName := msan
-SubDirs :=
-
-Sources := $(foreach file,$(wildcard $(Dir)/*.cc),$(notdir $(file)))
-ObjNames := $(Sources:%.cc=%.o)
-
-Implementation := Generic
-
-# FIXME: use automatic dependencies?
-Dependencies := $(wildcard $(Dir)/*.h)
-Dependencies += $(wildcard $(Dir)/../interception/*.h)
-Dependencies += $(wildcard $(Dir)/../sanitizer_common/*.h)
-
-# Define a convenience variable for all the msan functions.
-MsanFunctions := $(Sources:%.cc=%)
diff --git a/lib/tsan/Makefile.mk b/lib/tsan/Makefile.mk
deleted file mode 100644
index 70fb610bd..000000000
--- a/lib/tsan/Makefile.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#===- lib/tsan/Makefile.mk ---------------------------------*- Makefile -*--===#
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-#===------------------------------------------------------------------------===#
-
-ModuleName := tsan
-SubDirs := rtl
-Sources :=
-ObjNames :=
-Dependencies :=
-
-Implementation := Generic
-
-TsanFunctions :=
diff --git a/lib/tsan/rtl/Makefile.mk b/lib/tsan/rtl/Makefile.mk
deleted file mode 100644
index 2687123f7..000000000
--- a/lib/tsan/rtl/Makefile.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#===- lib/tsan/rtl/Makefile.mk -----------------------------*- Makefile -*--===#
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-#===------------------------------------------------------------------------===#
-
-ModuleName := tsan
-SubDirs :=
-
-Sources := $(foreach file,$(wildcard $(Dir)/*.cc),$(notdir $(file)))
-AsmSources := $(foreach file,$(wildcard $(Dir)/*.S),$(notdir $(file)))
-ObjNames := $(Sources:%.cc=%.o) $(AsmSources:%.S=%.o)
-
-Implementation := Generic
-
-# FIXME: use automatic dependencies?
-Dependencies := $(wildcard $(Dir)/*.h)
-Dependencies += $(wildcard $(Dir)/../../interception/*.h)
-Dependencies += $(wildcard $(Dir)/../../sanitizer_common/*.h)
-
-# Define a convenience variable for all the tsan functions.
-TsanFunctions += $(Sources:%.cc=%) $(AsmSources:%.S=%)
diff --git a/make/platform/clang_linux.mk b/make/platform/clang_linux.mk
index fc4405734..cb023f3db 100644
--- a/make/platform/clang_linux.mk
+++ b/make/platform/clang_linux.mk
@@ -49,80 +49,34 @@ endif
# Build runtime libraries for i386.
ifeq ($(call contains,$(SupportedArches),i386),true)
-Configs += builtins-i386 profile-i386 san-i386 asan-i386 asan_cxx-i386 \
- ubsan-i386 ubsan_cxx-i386
+Configs += builtins-i386 profile-i386
Arch.builtins-i386 := i386
Arch.profile-i386 := i386
-Arch.san-i386 := i386
-Arch.asan-i386 := i386
-Arch.asan_cxx-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 += builtins-x86_64 profile-x86_64 san-x86_64 asan-x86_64 asan_cxx-x86_64 \
- tsan-x86_64 msan-x86_64 ubsan-x86_64 ubsan_cxx-x86_64 dfsan-x86_64 \
- lsan-x86_64
+Configs += builtins-x86_64 profile-x86_64
Arch.builtins-x86_64 := x86_64
Arch.profile-x86_64 := x86_64
-Arch.san-x86_64 := x86_64
-Arch.asan-x86_64 := x86_64
-Arch.asan_cxx-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
-Arch.dfsan-x86_64 := x86_64
-Arch.lsan-x86_64 := x86_64
endif
endif
-ifneq ($(LLVM_ANDROID_TOOLCHAIN_DIR),)
-Configs += asan-arm-android
-Arch.asan-arm-android := arm-android
-endif
-
endif
###
CFLAGS := -Wall -Werror -O3 -fomit-frame-pointer
-SANITIZER_CFLAGS := -fPIE -fno-builtin -gline-tables-only
CFLAGS.builtins-i386 := $(CFLAGS) -m32
CFLAGS.builtins-x86_64 := $(CFLAGS) -m64
CFLAGS.profile-i386 := $(CFLAGS) -m32
CFLAGS.profile-x86_64 := $(CFLAGS) -m64
-CFLAGS.san-i386 := $(CFLAGS) -m32 $(SANITIZER_CFLAGS) -fno-rtti
-CFLAGS.san-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS) -fno-rtti
-CFLAGS.asan-i386 := $(CFLAGS) -m32 $(SANITIZER_CFLAGS) -fno-rtti
-CFLAGS.asan-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS) -fno-rtti
-CFLAGS.asan_cxx-i386 := $(CFLAGS) -m32 $(SANITIZER_CFLAGS) -fno-rtti
-CFLAGS.asan_cxx-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS) -fno-rtti
-CFLAGS.tsan-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS) -fno-rtti
-CFLAGS.msan-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS) -fno-rtti
-CFLAGS.ubsan-i386 := $(CFLAGS) -m32 $(SANITIZER_CFLAGS) -fno-rtti
-CFLAGS.ubsan-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS) -fno-rtti
-CFLAGS.ubsan_cxx-i386 := $(CFLAGS) -m32 $(SANITIZER_CFLAGS)
-CFLAGS.ubsan_cxx-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS)
-CFLAGS.dfsan-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS) -fno-rtti
-CFLAGS.lsan-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS) -fno-rtti
-
-SHARED_LIBRARY.asan-arm-android := 1
-ANDROID_COMMON_FLAGS := -target arm-linux-androideabi \
- --sysroot=$(LLVM_ANDROID_TOOLCHAIN_DIR)/sysroot \
- -B$(LLVM_ANDROID_TOOLCHAIN_DIR)
-CFLAGS.asan-arm-android := $(CFLAGS) $(SANITIZER_CFLAGS) \
- $(ANDROID_COMMON_FLAGS) -fno-rtti
-LDFLAGS.asan-arm-android := $(LDFLAGS) $(ANDROID_COMMON_FLAGS) -ldl -lm -llog \
- -lstdc++ -Wl,-soname=libclang_rt.asan-arm-android.so -Wl,-z,defs
# Use our stub SDK as the sysroot to support more portable building. For now we
# just do this for the core module, because the stub SDK doesn't have
-# enough support to build the sanitizers or profile runtimes.
+# enough support to build the profile runtime.
CFLAGS.builtins-i386 += --sysroot=$(ProjSrcRoot)/SDKs/linux
CFLAGS.builtins-x86_64 += --sysroot=$(ProjSrcRoot)/SDKs/linux
@@ -132,29 +86,6 @@ FUNCTIONS.profile-i386 := GCDAProfiling InstrProfiling InstrProfilingBuffer \
InstrProfilingFile InstrProfilingPlatformOther \
InstrProfilingRuntime
FUNCTIONS.profile-x86_64 := $(FUNCTIONS.profile-i386)
-FUNCTIONS.san-i386 := $(SanitizerCommonFunctions)
-FUNCTIONS.san-x86_64 := $(SanitizerCommonFunctions)
-FUNCTIONS.asan-i386 := $(AsanFunctions) $(InterceptionFunctions) \
- $(SanitizerCommonFunctions)
-FUNCTIONS.asan-x86_64 := $(AsanFunctions) $(InterceptionFunctions) \
- $(SanitizerCommonFunctions) $(LsanCommonFunctions)
-FUNCTIONS.asan_cxx-i386 := $(AsanCXXFunctions)
-FUNCTIONS.asan_cxx-x86_64 := $(AsanCXXFunctions)
-FUNCTIONS.asan-arm-android := $(AsanFunctions) $(AsanCXXFunctions) \
- $(InterceptionFunctions) \
- $(SanitizerCommonFunctions)
-FUNCTIONS.tsan-x86_64 := $(TsanFunctions) $(InterceptionFunctions) \
- $(SanitizerCommonFunctions)
-FUNCTIONS.msan-x86_64 := $(MsanFunctions) $(InterceptionFunctions) \
- $(SanitizerCommonFunctions)
-FUNCTIONS.ubsan-i386 := $(UbsanFunctions)
-FUNCTIONS.ubsan-x86_64 := $(UbsanFunctions)
-FUNCTIONS.ubsan_cxx-i386 := $(UbsanCXXFunctions)
-FUNCTIONS.ubsan_cxx-x86_64 := $(UbsanCXXFunctions)
-FUNCTIONS.dfsan-x86_64 := $(DfsanFunctions) $(InterceptionFunctions) \
- $(SanitizerCommonFunctions)
-FUNCTIONS.lsan-x86_64 := $(LsanFunctions) $(InterceptionFunctions) \
- $(SanitizerCommonFunctions)
# Always use optimized variants.
OPTIMIZED := 1