We had a special case to zero out the Target field for package
"unsafe", which is not imported from a normal object file.
As of CL 449376 that special case has been folded into go/build's
logic for setting the PkgObj field, so the special case in
cmd/go/internal/load has become redundant.
(Noticed while investigating CL 449376.)
Updates #47257.
Updates #56687.
Change-Id: I1668123aa6230097aa75e55380d3e2c7937c4b64
Reviewed-on: https://go-review.googlesource.com/c/go/+/449515
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
// Local import turned into absolute path.
// No permanent install target.
p.Target = ""
+ } else if p.Standard && cfg.BuildContext.Compiler == "gccgo" {
+ // gccgo has a preinstalled standard library that cmd/go cannot rebuild.
+ p.Target = ""
} else {
p.Target = p.Internal.Build.PkgObj
if cfg.BuildBuildmode == "shared" && p.Internal.Build.PkgTargetRoot != "" {
p.setBuildInfo(opts.AutoVCS)
}
- // unsafe is a fake package.
- if p.Standard && (p.ImportPath == "unsafe" || cfg.BuildContext.Compiler == "gccgo") {
- p.Target = ""
- }
-
// If cgo is not enabled, ignore cgo supporting sources
// just as we ignore go files containing import "C".
if !cfg.BuildContext.CgoEnabled {