aboutsummaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2021-05-13 19:22:57 -0400
committerCherry Mui <cherryyz@google.com>2021-05-18 15:00:55 +0000
commit690a8c3fb136431d4f22894c545ea99278758570 (patch)
treed2b901b91775fff92b954f316310a0f17fb81b17 /src/make.bash
parent8b0901fd32aa9c29a1fa4ed8cd517914920a1509 (diff)
downloadgo-690a8c3fb136431d4f22894c545ea99278758570.tar.gz
go-690a8c3fb136431d4f22894c545ea99278758570.zip
make.bash: fix misuse of continue
Apparently, in bash, the "continue" keyword can only be used inside of a loop, not in an if block. If readelf exists but $CC does not, make.bash emits a warning: ./make.bash: line 135: continue: only meaningful in a `for', `while', or `until' loop Change it to a conditional. Change-Id: I00a0940ed99bc0c565094e506705961b6b3d362e Reviewed-on: https://go-review.googlesource.com/c/go/+/320170 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/make.bash b/src/make.bash
index 3d1b0c87e7..4fb13f6275 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -132,10 +132,11 @@ fi
# Test which linker/loader our system is using
if type readelf >/dev/null 2>&1; then
- echo "int main() { return 0; }" | ${CC:-cc} -o ./test-musl-ldso -x c - || continue
- LDSO=$(readelf -l ./test-musl-ldso | grep 'interpreter:' | sed -e 's/^.*interpreter: \(.*\)[]]/\1/') >/dev/null 2>&1
- [ -z "$LDSO" ] || export GO_LDSO="$LDSO"
- rm -f ./test-musl-ldso
+ if echo "int main() { return 0; }" | ${CC:-cc} -o ./test-musl-ldso -x c - >/dev/null 2>&1; then
+ LDSO=$(readelf -l ./test-musl-ldso | grep 'interpreter:' | sed -e 's/^.*interpreter: \(.*\)[]]/\1/') >/dev/null 2>&1
+ [ -z "$LDSO" ] || export GO_LDSO="$LDSO"
+ rm -f ./test-musl-ldso
+ fi
fi
# Clean old generated file that will cause problems in the build.