writefile(out, file, 0)
}
+
+// mkzbootstrap writes cmd/internal/obj/zbootstrap.go:
+//
+// package obj
+//
+// const defaultGOROOT = <goroot>
+// const defaultGOARM = <goarm>
+// const defaultGOOS = <goos>
+// const defaultGOARCH = <goarch>
+// const version = <version>
+// const goexperiment = <goexperiment>
+//
+func mkzbootstrap(file string) {
+ out := fmt.Sprintf(
+ "// auto generated by go tool dist\n"+
+ "\n"+
+ "package obj\n"+
+ "\n"+
+ "const defaultGOROOT = `%s`\n"+
+ "const defaultGOARM = `%s`\n"+
+ "const defaultGOOS = `%s`\n"+
+ "const defaultGOARCH = `%s`\n"+
+ "const version = `%s`\n"+
+ "const goexperiment = `%s`\n",
+ goroot_final, goarm, gohostos, gohostarch, goversion, os.Getenv("GOEXPERIMENT"))
+
+ writefile(out, file, 0)
+}
}
xprintf("##### Building Go toolchain using %s.\n", goroot_bootstrap)
+ mkzbootstrap(pathf("%s/src/cmd/internal/obj/zbootstrap.go", goroot))
+
// Use $GOROOT/pkg/bootstrap as the bootstrap workspace root.
// We use a subdirectory of $GOROOT/pkg because that's the
// space within $GOROOT where we store all generated objects.