mirror of https://github.com/golang/go.git
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/28544 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
1a42d8fbd6
commit
675ba53c76
|
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue