Skip to content

Commit a21bb83

Browse files
committed
cmd/dist: disable PGO for toolchain2 build
Toolchain2 is only used for building toolchain3. We don't need to build it with PGO. And building with PGO causes packages to be built twice (one with PGO for the compiler, one without for other programs). Disable PGO for toolchain2. Also, I thought cmd/dist requires toolchain2 and toolchain3 compilers are identical binaries, so they need to be built in the same way. But it doesn't. Change-Id: Iaf49816da3dd06db79b48482c0e2435e09b512d7 Reviewed-on: https://go-review.googlesource.com/c/go/+/501335 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Michael Pratt <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Run-TryBot: Cherry Mui <[email protected]>
1 parent b52950f commit a21bb83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cmd/dist/build.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,8 @@ func cmdbootstrap() {
14571457
os.Setenv("CC", compilerEnvLookup("CC", defaultcc, goos, goarch))
14581458
// Now that cmd/go is in charge of the build process, enable GOEXPERIMENT.
14591459
os.Setenv("GOEXPERIMENT", goexperiment)
1460-
goInstall(toolenv(), goBootstrap, toolchain...)
1460+
// No need to enable PGO for toolchain2.
1461+
goInstall(toolenv(), goBootstrap, append([]string{"-pgo=off"}, toolchain...)...)
14611462
if debug {
14621463
run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
14631464
copyfile(pathf("%s/compile2", tooldir), pathf("%s/compile", tooldir), writeExec)

0 commit comments

Comments
 (0)