Default concurrency is now GOMAXPROCS, though this is normally
reduced to 4 by the go build commmand.
If compiler flags don't permit concurrency, silently
turn it down instead of failing the compilation.
Change-Id: Id26cc3214e0ca402d60f915e98276a58d809e097
Reviewed-on: https://go-review.googlesource.com/c/go/+/447358
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
func ParseFlags() {
Flag.I = addImportDir
- Flag.LowerC = 1
+ Flag.LowerC = runtime.GOMAXPROCS(0)
Flag.LowerD = objabi.NewDebugFlag(&Debug, DebugSSA)
Flag.LowerP = &Ctxt.Pkgpath
Flag.LowerV = &Ctxt.Debugvlog
if Flag.LowerC < 1 {
log.Fatalf("-c must be at least 1, got %d", Flag.LowerC)
}
- if Flag.LowerC > 1 && !concurrentBackendAllowed() {
- log.Fatalf("cannot use concurrent backend compilation with provided flags; invoked as %v", os.Args)
+ if !concurrentBackendAllowed() {
+ Flag.LowerC = 1
}
if Flag.CompilingRuntime {