[compiler-rt] 704eb99 - tsan: fix string comparison in Go build script

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 01:36:51 PDT 2023


Author: Dmitry Vyukov
Date: 2023-05-17T10:36:45+02:00
New Revision: 704eb9938387d38c4289890872247121f5a9382d

URL: https://github.com/llvm/llvm-project/commit/704eb9938387d38c4289890872247121f5a9382d
DIFF: https://github.com/llvm/llvm-project/commit/704eb9938387d38c4289890872247121f5a9382d.diff

LOG: tsan: fix string comparison in Go build script

Some bots failed with:

buildgo.sh: 173: [: linux: unexpected operator
Unknown platform

https://lab.llvm.org/buildbot/#/builders/247/builds/4603

Reviewed By: dyung

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/tsan/go/buildgo.sh b/compiler-rt/lib/tsan/go/buildgo.sh
index 0c5c5920b0a7..0bd59368cc46 100755
--- a/compiler-rt/lib/tsan/go/buildgo.sh
+++ b/compiler-rt/lib/tsan/go/buildgo.sh
@@ -78,7 +78,7 @@ SRCS="
 	../../sanitizer_common/sanitizer_termination.cpp
 "
 
-if [ "$GOOS" == "linux" ]; then
+if [ "$GOOS" = "linux" ]; then
 	OSCFLAGS="-fPIC -Wno-maybe-uninitialized"
 	OSLDFLAGS="-lpthread -fPIC -fpie"
 	SRCS="
@@ -93,26 +93,26 @@ if [ "$GOOS" == "linux" ]; then
 		../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
 		../../sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cpp
 		"
-	if [ "$GOARCH" == "ppc64le" ]; then
+	if [ "$GOARCH" = "ppc64le" ]; then
 		ARCHCFLAGS="-m64 -mcpu=power8 -fno-function-sections"
-	elif [ "$GOARCH" == "amd64" ]; then
+	elif [ "$GOARCH" = "amd64" ]; then
 		if [ "$GOAMD64" = "v3" ]; then
 			ARCHCFLAGS="-m64 -msse4.2"
 		else
 			ARCHCFLAGS="-m64 -msse3"
 		fi
 		OSCFLAGS="$OSCFLAGS -ffreestanding -Wno-unused-const-variable -Wno-unknown-warning-option"
-	elif [ "$GOARCH" == "arm64" ]; then
+	elif [ "$GOARCH" = "arm64" ]; then
 		ARCHCFLAGS=""
-	elif [ "$GOARCH" == "mips64le" ]; then
+	elif [ "$GOARCH" = "mips64le" ]; then
 		ARCHCFLAGS="-mips64 -EL"
-	elif [ "$GOARCH" == "mips64" ]; then
+	elif [ "$GOARCH" = "mips64" ]; then
 		ARCHCFLAGS="-mips64 -EB"
-	elif [ "$GOARCH" == "s390x" ]; then
+	elif [ "$GOARCH" = "s390x" ]; then
 		SRCS="$SRCS ../../sanitizer_common/sanitizer_linux_s390.cpp"
 		ARCHCFLAGS=""
 	fi
-elif [ "$GOOS" == "freebsd" ]; then
+elif [ "$GOOS" = "freebsd" ]; then
 	# The resulting object still depends on libc.
 	# We removed this dependency for Go runtime for other OSes,
 	# and we should remove it for FreeBSD as well, but there is no pressing need.
@@ -132,7 +132,7 @@ elif [ "$GOOS" == "freebsd" ]; then
 		../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
 		../../sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cpp
 	"
-elif [ "$GOOS" == "netbsd" ]; then
+elif [ "$GOOS" = "netbsd" ]; then
 	# The resulting object still depends on libc.
 	# We removed this dependency for Go runtime for other OSes,
 	# and we should remove it for NetBSD as well, but there is no pressing need.
@@ -153,7 +153,7 @@ elif [ "$GOOS" == "netbsd" ]; then
 		../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
 		../../sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cpp
 	"
-elif [ "$GOOS" == "darwin" ]; then
+elif [ "$GOOS" = "darwin" ]; then
 	OSCFLAGS="-fPIC -Wno-unused-const-variable -Wno-unknown-warning-option -mmacosx-version-min=10.7"
 	OSLDFLAGS="-lpthread -fPIC -fpie -mmacosx-version-min=10.7"
 	SRCS="
@@ -165,12 +165,12 @@ elif [ "$GOOS" == "darwin" ]; then
 		../../sanitizer_common/sanitizer_posix_libcdep.cpp
 		../../sanitizer_common/sanitizer_procmaps_mac.cpp
 	"
-	if [ "$GOARCH" == "amd64" ]; then
+	if [ "$GOARCH" = "amd64" ]; then
 		ARCHCFLAGS="-m64"
-	elif [ "$GOARCH" == "arm64" ]; then
+	elif [ "$GOARCH" = "arm64" ]; then
 		ARCHCFLAGS=""
 	fi
-elif [ "$GOOS" == "windows" ]; then
+elif [ "$GOOS" = "windows" ]; then
 	OSCFLAGS="-Wno-error=attributes -Wno-attributes -Wno-unused-const-variable -Wno-unknown-warning-option"
 	ARCHCFLAGS="-m64"
 	OSLDFLAGS=""
@@ -230,7 +230,7 @@ if [ "$DEPENDS_ON_LIBC" != "1" ]; then
 	fi
 fi
 
-if [ "$SKIP_TEST" == "1" ]; then
+if [ "$SKIP_TEST" = "1" ]; then
 	exit 0
 fi
 


        


More information about the llvm-commits mailing list