go1.18: Dynamic linker path is hardcoded to glibc's dynamic linker #51790
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
What version of Go are you using (
go version
)?1.18
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?Linux, any processor architecture
What did you do?
Tried to build a dynamically linked go application on a Linux system using a libc other than glibc (musl, uClibc-ng)
What did you expect to see?
Working application
What did you see instead?
"No such file or directory"
The cause is that go hardcodes the filename of glibc's dynamic linker, and puts that into the ELF header, e.g.
https://github.com/golang/go/blob/master/src/cmd/link/internal/x86/obj.go#L64
https://github.com/golang/go/blob/master/src/cmd/link/internal/amd64/obj.go#L67
when it should be using ld-musl-x86_64.so.1 etc. on a linux-musl system.
There is some handling for the similar case of Linux-but-not-glibc Android at
https://github.com/golang/go/blob/master/src/cmd/link/internal/ld/elf.go#L1769
Probably an equivalent fix is the easiest way to support other non-glibc linux systems.
The text was updated successfully, but these errors were encountered: