tsan: remove duplicate arch switch in buildgo.sh
authorDmitry Vyukov <dvyukov@google.com>
Mon, 19 Jul 2021 13:51:08 +0000 (15:51 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Mon, 19 Jul 2021 15:19:17 +0000 (17:19 +0200)
For some reason we have 2 switches on arch and add
half of arch flags in one place and half in another.
Merge these 2 switches.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D106274

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

index b57bb4e..a16735d 100755 (executable)
@@ -57,10 +57,10 @@ if [ "`uname -a | grep Linux`" != "" ]; then
                "
        if [ "`uname -a | grep ppc64le`" != "" ]; then
                SUFFIX="linux_ppc64le"
-               ARCHCFLAGS="-m64"
+               ARCHCFLAGS="-m64 -mcpu=power8 -fno-function-sections"
        elif [ "`uname -a | grep x86_64`" != "" ]; then
                SUFFIX="linux_amd64"
-               ARCHCFLAGS="-m64"
+               ARCHCFLAGS="-m64 -msse3"
                OSCFLAGS="$OSCFLAGS -ffreestanding -Wno-unused-const-variable -Werror -Wno-unknown-warning-option"
        elif [ "`uname -a | grep aarch64`" != "" ]; then
                SUFFIX="linux_arm64"
@@ -179,11 +179,6 @@ done
 FLAGS=" -I../rtl -I../.. -I../../sanitizer_common -I../../../include -std=c++14 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO=1 -DSANITIZER_DEADLOCK_DETECTOR_VERSION=2 $OSCFLAGS $ARCHCFLAGS $EXTRA_CFLAGS"
 DEBUG_FLAGS="$FLAGS -DSANITIZER_DEBUG=1 -g"
 FLAGS="$FLAGS -DSANITIZER_DEBUG=0 -O3 -fomit-frame-pointer"
-if [ "$SUFFIX" = "linux_ppc64le" ]; then
-       FLAGS="$FLAGS -mcpu=power8 -fno-function-sections"
-elif [ "$SUFFIX" = "linux_amd64" ]; then
-       FLAGS="$FLAGS -msse3"
-fi
 
 if [ "$DEBUG" = "" ]; then
        # Do a build test with debug flags.