diff --git a/src/make.bash b/src/make.bash index b58f27bb1b..3d1b0c87e7 100755 --- a/src/make.bash +++ b/src/make.bash @@ -130,13 +130,12 @@ if [ "$(uname -s)" = "GNU/kFreeBSD" ]; then export CGO_ENABLED=0 fi -# On Alpine Linux, use the musl dynamic linker/loader -if [ -f "/etc/alpine-release" ]; then - if type readelf >/dev/null 2>&1; then - echo "int main() { return 0; }" | ${CC:-gcc} -o ./test-alpine-ldso -x c - - export GO_LDSO=$(readelf -l ./test-alpine-ldso | grep 'interpreter:' | sed -e 's/^.*interpreter: \(.*\)[]]/\1/') - rm -f ./test-alpine-ldso - 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 fi # Clean old generated file that will cause problems in the build.