diff options
| author | Russ Cox <rsc@golang.org> | 2022-08-02 10:12:52 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-08-08 21:12:57 +0000 |
| commit | 3315066f46d5dce3e4474bdcde0997d688c79436 (patch) | |
| tree | aba25c60d06164f94aff61c5f8d9082973f9ae9e /src/make.bash | |
| parent | 52dfdc5e1e6f4f8ddd99f238e37b6c255f5ab6bd (diff) | |
| download | go-3315066f46d5dce3e4474bdcde0997d688c79436.tar.xz | |
cmd/link: detect glibc vs musl ldso at link time
Doing the test at link time lets us distribute one Linux toolchain
that works on both glibc-based and musl-based Linux systems.
The old way built a toolchain that only ran on one or the other.
Fixes #54197.
Change-Id: Iaae8c274c78e1091eee828a720b49646be9bfffe
Reviewed-on: https://go-review.googlesource.com/c/go/+/420774
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/make.bash')
| -rwxr-xr-x | src/make.bash | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/make.bash b/src/make.bash index ab2ce19f4e..54bb070513 100755 --- a/src/make.bash +++ b/src/make.bash @@ -133,15 +133,6 @@ if [ "$(uname -s)" = "GNU/kFreeBSD" ]; then export CGO_ENABLED=0 fi -# Test which linker/loader our system is using, if GO_LDSO is not set. -if [ -z "$GO_LDSO" ] && type readelf >/dev/null 2>&1; then - 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. rm -f ./runtime/runtime_defs.go |
