From 7a96ecde4dd2cd1cb85695952ad9abc2e8894296 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Fri, 3 Apr 2015 04:37:25 -0400 Subject: [PATCH] cmd/internal/ld: force external linking on linux/arm64 with cgo MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Update #10373. Change-Id: I309e3df7608b9eef9339196fdc50dedf5f9439f5 Reviewed-on: https://go-review.googlesource.com/8452 Reviewed-by: Aram Hăvărneanu Reviewed-by: David Crawshaw --- src/cmd/internal/ld/lib.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cmd/internal/ld/lib.go b/src/cmd/internal/ld/lib.go index 1b4d651068..94c0562b0f 100644 --- a/src/cmd/internal/ld/lib.go +++ b/src/cmd/internal/ld/lib.go @@ -369,6 +369,12 @@ func loadlib() { } } + // cmd/7l doesn't support cgo internal linking + // This is https://golang.org/issue/10373. + if iscgo && goarch == "arm64" { + Linkmode = LinkExternal + } + if Linkmode == LinkExternal && !iscgo { // This indicates a user requested -linkmode=external. // The startup code uses an import of runtime/cgo to decide -- 2.48.1