Skip to content

Commit 690a8c3

Browse files
committed
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 <[email protected]> Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Cuong Manh Le <[email protected]>
1 parent 8b0901f commit 690a8c3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/make.bash

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,11 @@ fi
132132

133133
# Test which linker/loader our system is using
134134
if type readelf >/dev/null 2>&1; then
135-
echo "int main() { return 0; }" | ${CC:-cc} -o ./test-musl-ldso -x c - || continue
136-
LDSO=$(readelf -l ./test-musl-ldso | grep 'interpreter:' | sed -e 's/^.*interpreter: \(.*\)[]]/\1/') >/dev/null 2>&1
137-
[ -z "$LDSO" ] || export GO_LDSO="$LDSO"
138-
rm -f ./test-musl-ldso
135+
if echo "int main() { return 0; }" | ${CC:-cc} -o ./test-musl-ldso -x c - >/dev/null 2>&1; then
136+
LDSO=$(readelf -l ./test-musl-ldso | grep 'interpreter:' | sed -e 's/^.*interpreter: \(.*\)[]]/\1/') >/dev/null 2>&1
137+
[ -z "$LDSO" ] || export GO_LDSO="$LDSO"
138+
rm -f ./test-musl-ldso
139+
fi
139140
fi
140141

141142
# Clean old generated file that will cause problems in the build.

0 commit comments

Comments
 (0)