[compiler-rt] r177247 - [TSan] Makefiles: allow configurable paths to clang and FileCheck. Add -fno-rtti flag.
Alexey Samsonov
samsonov at google.com
Mon Mar 18 00:00:37 PDT 2013
Author: samsonov
Date: Mon Mar 18 02:00:36 2013
New Revision: 177247
URL: http://llvm.org/viewvc/llvm-project?rev=177247&view=rev
Log:
[TSan] Makefiles: allow configurable paths to clang and FileCheck. Add -fno-rtti flag.
Modified:
compiler-rt/trunk/lib/tsan/Makefile.old
compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh
compiler-rt/trunk/lib/tsan/rtl/Makefile.old
Modified: compiler-rt/trunk/lib/tsan/Makefile.old
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/Makefile.old?rev=177247&r1=177246&r2=177247&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/Makefile.old (original)
+++ compiler-rt/trunk/lib/tsan/Makefile.old Mon Mar 18 02:00:36 2013
@@ -1,13 +1,15 @@
DEBUG=0
LDFLAGS=-ldl -lpthread -pie
-CXXFLAGS = -fPIE -g -Wall -Werror -DTSAN_DEBUG=$(DEBUG) -DSANITIZER_DEBUG=$(DEBUG)
+CXXFLAGS = -fPIE -fno-rtti -g -Wall -Werror \
+ -DGTEST_HAS_RTTI=0 -DTSAN_DEBUG=$(DEBUG) -DSANITIZER_DEBUG=$(DEBUG)
+CLANG=clang
# Silence warnings that Clang produces for gtest code.
# Use -Wno-attributes so that gcc doesn't complain about unknown warning types.
CXXFLAGS += -Wno-attributes
ifeq ($(DEBUG), 0)
CXXFLAGS += -O3
endif
-ifeq ($(CXX), clang++)
+ifeq ($(CXX), $(CLANG)++)
CXXFLAGS+= -Wno-unused-private-field -Wno-static-in-inline -Wgnu
endif
@@ -54,16 +56,16 @@ test: libtsan tsan_test
run: all
(ulimit -s 8192; ./tsan_test)
- ./lit_tests/test_output.sh
+ CC=$(CLANG) CXX=$(CLANG)++ ./lit_tests/test_output.sh
presubmit:
../sanitizer_common/scripts/check_lint.sh
# Debug build with clang.
$(MAKE) -f Makefile.old clean
- $(MAKE) -f Makefile.old run DEBUG=1 -j 16 CC=clang CXX=clang++
+ $(MAKE) -f Makefile.old run DEBUG=1 -j 16 CC=$(CLANG) CXX=$(CLANG)++
# Release build with clang.
$(MAKE) -f Makefile.old clean
- $(MAKE) -f Makefile.old run DEBUG=0 -j 16 CC=clang CXX=clang++
+ $(MAKE) -f Makefile.old run DEBUG=0 -j 16 CC=$(CLANG) CXX=$(CLANG)++
# Debug build with gcc
$(MAKE) -f Makefile.old clean
$(MAKE) -f Makefile.old run DEBUG=1 -j 16 CC=gcc CXX=g++
Modified: compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh?rev=177247&r1=177246&r2=177247&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh Mon Mar 18 02:00:36 2013
@@ -6,9 +6,10 @@ set -e # fail on any error
ROOTDIR=$(dirname $0)/..
BLACKLIST=$ROOTDIR/lit_tests/Helpers/blacklist.txt
-# Assuming clang is in path.
-CC=clang
-CXX=clang++
+# Assume clang and clang++ are in path.
+: ${CC:=clang}
+: ${CXX:=clang++}
+: ${FILECHECK:=FileCheck}
# TODO: add testing for all of -O0...-O3
CFLAGS="-fsanitize=thread -fsanitize-blacklist=$BLACKLIST -fPIE -O1 -g -fno-builtin -Wall"
@@ -23,7 +24,7 @@ test_file() {
$COMPILER $SRC $CFLAGS -c -o $OBJ
$COMPILER $OBJ $LDFLAGS -o $EXE
RES=$($EXE 2>&1 || true)
- printf "%s\n" "$RES" | FileCheck $SRC
+ printf "%s\n" "$RES" | $FILECHECK $SRC
if [ "$3" == "" ]; then
rm -f $EXE $OBJ
fi
Modified: compiler-rt/trunk/lib/tsan/rtl/Makefile.old
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/Makefile.old?rev=177247&r1=177246&r2=177247&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/Makefile.old (original)
+++ compiler-rt/trunk/lib/tsan/rtl/Makefile.old Mon Mar 18 02:00:36 2013
@@ -10,7 +10,7 @@ endif
INTERCEPTION=../../interception
COMMON=../../sanitizer_common
INCLUDES= -I../.. -I../../../include
-EXTRA_CXXFLAGS=-fno-exceptions
+EXTRA_CXXFLAGS=-fno-exceptions -fno-rtti
NO_SYSROOT=--sysroot=.
CXXFLAGS+=$(EXTRA_CXXFLAGS)
CXXFLAGS+=$(CFLAGS)
More information about the llvm-commits
mailing list