From: Josh Bleecher Snyder Date: Mon, 4 Oct 2021 19:14:10 +0000 (-0700) Subject: cmd/go,cmd/compile: re-enable concurrent compilation on darwin/arm64 X-Git-Tag: go1.18beta1~1077 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=579ff8b1313479b795e3b536f7b9444094060b32;p=gostls13.git cmd/go,cmd/compile: re-enable concurrent compilation on darwin/arm64 I've manually reviewed all uses of ctxt.Flag_shared for concurrency safety. And I manually tested with the race detector and found no issues. Allow -shared to be used with compiler concurrency, thereby re-enabling concurrent compilation on darwin/arm64. Fixes #48496 Change-Id: I8a084cb08e6050950e404ceb9bd7e3a20e07e9c5 Reviewed-on: https://go-review.googlesource.com/c/go/+/353871 Trust: Josh Bleecher Snyder Reviewed-by: Bryan C. Mills --- diff --git a/src/cmd/compile/internal/base/flag.go b/src/cmd/compile/internal/base/flag.go index 942659bcc0..241f5da185 100644 --- a/src/cmd/compile/internal/base/flag.go +++ b/src/cmd/compile/internal/base/flag.go @@ -357,7 +357,7 @@ func concurrentBackendAllowed() bool { return false } // TODO: fix races and enable the following flags - if Ctxt.Flag_shared || Ctxt.Flag_dynlink || Flag.Race { + if Ctxt.Flag_dynlink || Flag.Race { return false } return true diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go index 414736cbd7..85f661bf31 100644 --- a/src/cmd/go/internal/work/gc.go +++ b/src/cmd/go/internal/work/gc.go @@ -234,7 +234,7 @@ CheckFlags: // except for known commonly used flags. // If the user knows better, they can manually add their own -c to the gcflags. switch flag { - case "-N", "-l", "-S", "-B", "-C", "-I": + case "-N", "-l", "-S", "-B", "-C", "-I", "-shared": // OK default: canDashC = false