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>
This commit is contained in:
Russ Cox 2022-08-02 10:12:52 -04:00 committed by Gopher Robot
parent 52dfdc5e1e
commit 3315066f46
12 changed files with 37 additions and 18 deletions

View file

@ -183,6 +183,7 @@ type Arch struct {
Androiddynld string
Linuxdynld string
LinuxdynldMusl string
Freebsddynld string
Netbsddynld string
Openbsddynld string