[TSan] Fix Go sanity check script.
authorAlexey Samsonov <vonosmas@gmail.com>
Mon, 2 Feb 2015 22:07:39 +0000 (22:07 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Mon, 2 Feb 2015 22:07:39 +0000 (22:07 +0000)
llvm-svn: 227870

compiler-rt/lib/tsan/CMakeLists.txt
compiler-rt/lib/tsan/go/buildgo.sh

index 1cbd83e..baf07a0 100644 (file)
@@ -101,10 +101,10 @@ endif()
 add_dependencies(compiler-rt tsan)
 
 # Sanity check for Go runtime.
+set(BUILDGO_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/go/buildgo.sh)
 add_custom_target(GotsanRuntimeCheck
-  COMMAND CC=${CMAKE_C_COMPILER} IN_TMPDIR=1 SILENT=1
-          ${CMAKE_CURRENT_SOURCE_DIR}/go/buildgo.sh
-  DEPENDS clang_rt.tsan-${arch}
+  COMMAND CC=${CMAKE_C_COMPILER} IN_TMPDIR=1 SILENT=1 ${BUILDGO_SCRIPT}
+  DEPENDS clang_rt.tsan-${arch} ${BUILDGO_SCRIPT}
   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/go
   COMMENT "Checking TSan Go runtime..."
   VERBATIM)
index c8cc1dc..e6f539e 100755 (executable)
@@ -35,7 +35,8 @@ if [ "`uname -a | grep Linux`" != "" ]; then
        SUFFIX="linux_amd64"
        OSCFLAGS="-fPIC -ffreestanding -Wno-maybe-uninitialized -Wno-unused-const-variable -Werror -Wno-unknown-warning-option"
        OSLDFLAGS="-lpthread -fPIC -fpie"
-       SRCS+="
+       SRCS="
+               $SRCS
                ../rtl/tsan_platform_linux.cc
                ../../sanitizer_common/sanitizer_posix.cc
                ../../sanitizer_common/sanitizer_posix_libcdep.cc
@@ -49,7 +50,8 @@ elif [ "`uname -a | grep FreeBSD`" != "" ]; then
         SUFFIX="freebsd_amd64"
         OSCFLAGS="-fno-strict-aliasing -fPIC -Werror"
         OSLDFLAGS="-lpthread -fPIC -fpie"
-        SRCS+="
+        SRCS="
+                $SRCS
                 ../rtl/tsan_platform_linux.cc
                 ../../sanitizer_common/sanitizer_posix.cc
                 ../../sanitizer_common/sanitizer_posix_libcdep.cc
@@ -63,7 +65,8 @@ elif [ "`uname -a | grep Darwin`" != "" ]; then
        SUFFIX="darwin_amd64"
        OSCFLAGS="-fPIC -Wno-unused-const-variable -Wno-unknown-warning-option"
        OSLDFLAGS="-lpthread -fPIC -fpie"
-       SRCS+="
+       SRCS="
+               $SRCS
                ../rtl/tsan_platform_mac.cc
                ../../sanitizer_common/sanitizer_mac.cc
                ../../sanitizer_common/sanitizer_posix.cc
@@ -74,7 +77,8 @@ elif [ "`uname -a | grep MINGW`" != "" ]; then
        SUFFIX="windows_amd64"
        OSCFLAGS="-Wno-error=attributes -Wno-attributes -Wno-unused-const-variable -Wno-unknown-warning-option"
        OSLDFLAGS=""
-       SRCS+="
+       SRCS="
+               $SRCS
                ../rtl/tsan_platform_windows.cc
                ../../sanitizer_common/sanitizer_win.cc
        "
@@ -97,7 +101,7 @@ else
   DIR=.
 fi
 
-SRCS+=$ADD_SRCS
+SRCS="$SRCS $ADD_SRCS"
 
 rm -f $DIR/gotsan.cc
 for F in $SRCS; do
@@ -106,9 +110,9 @@ done
 
 FLAGS=" -I../rtl -I../.. -I../../sanitizer_common -I../../../include -std=c++11 -m64 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO -DSANITIZER_DEADLOCK_DETECTOR_VERSION=2 $OSCFLAGS"
 if [ "$DEBUG" == "" ]; then
-       FLAGS+=" -DSANITIZER_DEBUG=0 -O3 -msse3 -fomit-frame-pointer"
+       FLAGS="$FLAGS -DSANITIZER_DEBUG=0 -O3 -msse3 -fomit-frame-pointer"
 else
-       FLAGS+=" -DSANITIZER_DEBUG=1 -g"
+       FLAGS="$FLAGS -DSANITIZER_DEBUG=1 -g"
 fi
 
 if [ "$SILENT" != "1" ]; then