1
0
mirror of https://github.com/golang/go synced 2024-11-17 17:54:48 -07:00

cmd/dist: omit cmd/cgo from toolchain1

We don't need cmd/cgo for building go_bootstrap or toolchain2, so skip
building it as part of toolchain1.

This allows cmd/cgo to assume a current go/ast; e.g., that
ast.IndexListExpr exists (needed for next CL).

Change-Id: I642bba780bf273e6ea9c6e7c5d5d7ccfe86bf462
Reviewed-on: https://go-review.googlesource.com/c/go/+/353884
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Matthew Dempsky 2021-10-04 16:42:13 -07:00
parent e5f6d8d00c
commit 81b7ec1ad5
2 changed files with 2 additions and 8 deletions

View File

@ -1359,7 +1359,7 @@ func cmdbootstrap() {
} }
// To recap, so far we have built the new toolchain // To recap, so far we have built the new toolchain
// (cmd/asm, cmd/cgo, cmd/compile, cmd/link) // (cmd/asm, cmd/compile, cmd/link)
// using Go 1.4's toolchain and go command. // using Go 1.4's toolchain and go command.
// Then we built the new go command (as go_bootstrap) // Then we built the new go command (as go_bootstrap)
// using the new toolchain and our own build logic (above). // using the new toolchain and our own build logic (above).

View File

@ -33,7 +33,6 @@ import (
var bootstrapDirs = []string{ var bootstrapDirs = []string{
"cmd/asm", "cmd/asm",
"cmd/asm/internal/...", "cmd/asm/internal/...",
"cmd/cgo",
"cmd/compile", "cmd/compile",
"cmd/compile/internal/...", "cmd/compile/internal/...",
"cmd/internal/archive", "cmd/internal/archive",
@ -102,6 +101,7 @@ func bootstrapBuildTools() {
mkbuildcfg(pathf("%s/src/internal/buildcfg/zbootstrap.go", goroot)) mkbuildcfg(pathf("%s/src/internal/buildcfg/zbootstrap.go", goroot))
mkobjabi(pathf("%s/src/cmd/internal/objabi/zbootstrap.go", goroot)) mkobjabi(pathf("%s/src/cmd/internal/objabi/zbootstrap.go", goroot))
mkzdefaultcc("", pathf("%s/src/cmd/cgo/zdefaultcc.go", goroot))
// Use $GOROOT/pkg/bootstrap as the bootstrap workspace root. // Use $GOROOT/pkg/bootstrap as the bootstrap workspace root.
// We use a subdirectory of $GOROOT/pkg because that's the // We use a subdirectory of $GOROOT/pkg because that's the
@ -134,12 +134,6 @@ func bootstrapBuildTools() {
} }
xmkdirall(dst) xmkdirall(dst)
if path == "cmd/cgo" {
// Write to src because we need the file both for bootstrap
// and for later in the main build.
mkzdefaultcc("", pathf("%s/zdefaultcc.go", src))
mkzdefaultcc("", pathf("%s/zdefaultcc.go", dst))
}
return nil return nil
} }