]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: force external link for windows/arm64 cgo binaries
authorRuss Cox <rsc@golang.org>
Wed, 14 Apr 2021 16:50:40 +0000 (12:50 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 23 Apr 2021 21:43:06 +0000 (21:43 +0000)
Change-Id: I833cac61125513fde4b93ebf14da8bab88908eab
Reviewed-on: https://go-review.googlesource.com/c/go/+/312040
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/cmd/link/internal/ld/config.go
src/cmd/link/internal/ld/lib.go

index 75fddc6a38e94c2797c378ddd154d204c54a1bb5..ae0d7520ebc0790360d3f399c9a0e517f449556c 100644 (file)
@@ -205,6 +205,10 @@ func mustLinkExternal(ctxt *Link) (res bool, reason string) {
                // doesn't work. Test case is "go test runtime/cgo".
                return true, buildcfg.GOOS + " does not support internal cgo"
        }
+       if iscgo && buildcfg.GOOS == "windows" && buildcfg.GOARCH == "arm64" {
+               // windows/arm64 internal linking is not implemented.
+               return true, buildcfg.GOOS + "/" + buildcfg.GOARCH + " does not support internal cgo"
+       }
 
        // When the race flag is set, the LLVM tsan relocatable file is linked
        // into the final binary, which means external linking is required because
index d2dc3fb175ba46b9781c1fa998d3484ca95eacd3..adf1669cf269acdeec24e4d6cf4060c496da6afa 100644 (file)
@@ -1868,7 +1868,7 @@ func ldobj(ctxt *Link, f *bio.Reader, lib *sym.Library, length int64, pn string,
                        return nil
                }
 
-               Errorf(nil, "%s: not an object file", pn)
+               Errorf(nil, "%s: not an object file: @%d %02x%02x%02x%02x", pn, start, c1, c2, c3, c4)
                return nil
        }