Commit f579faa6 authored by Russ Cox's avatar Russ Cox

cmd/go: diagnose un-bootstrapped runtime

Fixes #4665.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7132057
parent e985d546
......@@ -649,6 +649,16 @@ func (b *builder) do(root *action) {
wg.Wait()
}
// hasString reports whether s appears in the list of strings.
func hasString(strings []string, s string) bool {
for _, t := range strings {
if s == t {
return true
}
}
return false
}
// build is the action for building a single package or command.
func (b *builder) build(a *action) (err error) {
defer func() {
......@@ -669,6 +679,11 @@ func (b *builder) build(a *action) (err error) {
fmt.Fprintf(os.Stderr, "%s\n", a.p.ImportPath)
}
if a.p.Standard && a.p.ImportPath == "runtime" && buildContext.Compiler == "gc" &&
!hasString(a.p.HFiles, "zasm_"+buildContext.GOOS+"_"+buildContext.GOARCH+".h") {
return fmt.Errorf("%s/%s must be bootstrapped using make.bash", buildContext.GOOS, buildContext.GOARCH)
}
// Make build directory.
obj := a.objdir
if err := b.mkdir(obj); err != nil {
......
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