Commit 675ba53c authored by David Crawshaw's avatar David Crawshaw

cmd/go: internal PIE does not need runtime/cgo

Part of adding PIE internal linking on linux/amd64.

Change-Id: I57f0596cb254cbe6569e4d4e39fe4f48437733f2
Reviewed-on: https://go-review.googlesource.com/28544Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 1a42d8fb
......@@ -849,7 +849,8 @@ func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package
// Currently build modes c-shared, pie, and -linkshared force
// external linking mode, and external linking mode forces an
// import of runtime/cgo.
if p.Name == "main" && !p.Goroot && (buildBuildmode == "c-shared" || buildBuildmode == "pie" || buildLinkshared) {
pieCgo := buildBuildmode == "pie" && (buildContext.GOOS != "linux" || buildContext.GOARCH != "amd64")
if p.Name == "main" && !p.Goroot && (buildBuildmode == "c-shared" || pieCgo || buildLinkshared) {
importPaths = append(importPaths, "runtime/cgo")
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment