From ba7066a1311a9a232e422e6dd2b82f18a5758750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Tue, 7 Feb 2023 16:39:36 +0100 Subject: [PATCH] cmd/link: check for libssp_nonshared.a instead of libc_nonshared.a See: https://github.com/golang/go/issues/58385 --- src/cmd/link/internal/ld/lib.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 17df56f4d5..f593dcd895 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -643,9 +643,11 @@ func (ctxt *Link) loadlib() { // and "__stack_chk_fail_local" is unresolved (most // likely due to the use of -fstack-protector), try // loading libc_nonshared.a to resolve it. + // + // On Alpine, the library is called libssp_nonshared.a. isunresolved := symbolsAreUnresolved(ctxt, []string{"__stack_chk_fail_local"}) if isunresolved[0] { - if p := ctxt.findLibPath("libc_nonshared.a"); p != "none" { + if p := ctxt.findLibPath("libssp_nonshared.a"); p != "none" { hostArchive(ctxt, p) } }