make.bash: If ${CC} fails to make the executable, continue

if readelf cannot read the executable, GO_LDSO will not be set.
Otherwise, GO_LDSO is set to what readelf reads.
This commit is contained in:
Dilyn Corner 2021-03-15 19:14:00 -04:00
parent 43e9afa88f
commit b86ab6e05a
1 changed files with 3 additions and 2 deletions

View File

@ -132,8 +132,9 @@ 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 -
export GO_LDSO=$(readelf -l ./test-musl-ldso | grep 'interpreter:' | sed -e 's/^.*interpreter: \(.*\)[]]/\1/')
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
fi