[compiler-rt] r175737 - [sanitizer] Add MSan to Makefile-based build rules.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Thu Feb 21 05:55:54 PST 2013


Author: eugenis
Date: Thu Feb 21 07:55:54 2013
New Revision: 175737

URL: http://llvm.org/viewvc/llvm-project?rev=175737&view=rev
Log:
[sanitizer] Add MSan to Makefile-based build rules.

Added:
    compiler-rt/trunk/lib/msan/Makefile.mk
Modified:
    compiler-rt/trunk/lib/Makefile.mk
    compiler-rt/trunk/make/platform/clang_linux.mk

Modified: compiler-rt/trunk/lib/Makefile.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/Makefile.mk?rev=175737&r1=175736&r2=175737&view=diff
==============================================================================
--- compiler-rt/trunk/lib/Makefile.mk (original)
+++ compiler-rt/trunk/lib/Makefile.mk Thu Feb 21 07:55:54 2013
@@ -19,6 +19,7 @@ SubDirs += interception
 SubDirs += profile
 SubDirs += sanitizer_common
 SubDirs += tsan
+SubDirs += msan
 SubDirs += ubsan
 
 # FIXME: We don't currently support building an atomic library, and as it must

Added: compiler-rt/trunk/lib/msan/Makefile.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/Makefile.mk?rev=175737&view=auto
==============================================================================
--- compiler-rt/trunk/lib/msan/Makefile.mk (added)
+++ compiler-rt/trunk/lib/msan/Makefile.mk Thu Feb 21 07:55:54 2013
@@ -0,0 +1,24 @@
+#===- 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=%)

Modified: compiler-rt/trunk/make/platform/clang_linux.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/clang_linux.mk?rev=175737&r1=175736&r2=175737&view=diff
==============================================================================
--- compiler-rt/trunk/make/platform/clang_linux.mk (original)
+++ compiler-rt/trunk/make/platform/clang_linux.mk Thu Feb 21 07:55:54 2013
@@ -60,11 +60,13 @@ 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 ubsan-x86_64
+Configs += full-x86_64 profile-x86_64 asan-x86_64 tsan-x86_64 msan-x86_64 \
+           ubsan-x86_64
 Arch.full-x86_64 := x86_64
 Arch.profile-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
 endif
 
@@ -89,6 +91,7 @@ CFLAGS.asan-i386 := $(CFLAGS) -m32 -fPIE
 CFLAGS.asan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin \
                     -DASAN_FLEXIBLE_MAPPING_AND_OFFSET=1
 CFLAGS.tsan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin
+CFLAGS.msan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin
 CFLAGS.ubsan-i386 := $(CFLAGS) -m32 -fPIE -fno-builtin
 CFLAGS.ubsan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin
 
@@ -121,6 +124,8 @@ FUNCTIONS.asan-arm-android := $(AsanFunc
                                           $(SanitizerCommonFunctions)
 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)
 





More information about the llvm-commits mailing list