]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: run gcc to get errors and debug info in parallel
authormatloob <matloob@golang.org>
Mon, 25 Aug 2025 21:22:01 +0000 (17:22 -0400)
committerMichael Matloob <matloob@google.com>
Tue, 9 Sep 2025 23:41:05 +0000 (16:41 -0700)
commit4c20f7f15a9a8eed50d8cbb8be8f74d449093a5c
treec291f1e7b29921a6094e170a92bccf6bf8702d01
parent5dcedd65504cc9cadc9a5ea8bc3af51a26eec704
cmd/cgo: run gcc to get errors and debug info in parallel

This change kicks off the work to load the debug info when processing
each file, and then waits for all the files to be processed before
starting the single-goroutined part that processes them. The processing
is very order dependent so we won't try to make it concurrent. Though
in a later CL we can wait for only the relevant package to have been
processed concurrently before doing the single-goroutined processing for
it instead of waiting for all packages to be processed concurrently
before the single goroutine section.

We use a par.Queue to make sure we're not running too many gcc compiles
at the same time. The change to cmd/dist makes the par package available
to cgo.

Fixes #75167

Change-Id: I6a6a6964fb7f3a3684118b5ee66f1ad856b3ee59
Reviewed-on: https://go-review.googlesource.com/c/go/+/699020
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/cmd/cgo/gcc.go
src/cmd/cgo/main.go
src/cmd/dist/buildtool.go