-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: fix go command fails to perform concurrent compilation
CL 344909 fixed the bug in the order of passing gcflags from cmd/go to cmd/compile. In that process, we merged the flags passed by cmd/go and the flags specified by "-gcflags" to one variable. That causes the gcBackendConcurrency function fails to detect concurrency level, since when it expects only the latter flags. To fix this, just don't merge those two variables, so we can now correctly detect the concurrency level and passing the right -c to the compiler. Fixes #48490 Change-Id: I1293a7d6b946b7fccdd5cd34a38452bf6306e115 Reviewed-on: https://go-review.googlesource.com/c/go/+/351049 Trust: Cuong Manh Le <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
- Loading branch information
Showing
2 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Tests golang.org/issue/48490 | ||
# cmd/go should enable concurrent compilation by default | ||
|
||
# Skip test on darwin/arm64, see #48496. | ||
# TODO(cuonglm): remove this once #48496 is fixed. | ||
[darwin] [arm64] skip | ||
|
||
# Reset all experiments, since one of them can disable | ||
# concurrent compilation, e.g: fieldtrack. | ||
env GOEXPERIMENT=none | ||
|
||
env GOMAXPROCS=4 | ||
go build -n -x -a fmt | ||
stderr ' -c=4 ' |