]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: use objdir consistently, create it as needed
authorIan Lance Taylor <iant@golang.org>
Fri, 30 Jan 2026 23:33:49 +0000 (15:33 -0800)
committerGopher Robot <gobot@golang.org>
Wed, 4 Feb 2026 19:28:00 +0000 (11:28 -0800)
commit01299a31c26b730785ac497da2ef7c593947d5d7
treeaf685154925be25e22ead91fdbaee06484d81d23
parent1bbb78e7772e7530338e9f154936dc2479adafac
cmd/cgo: use objdir consistently, create it as needed

Previously we added a slash to the end of objdir only after
processing input files. The effect was that the temporary gcc
output files were placed in /tmp, using objdir as a prefix.
Those output files were not removed by anything.

Now we consistently use objdir as a directory, not a prefix.
We only create it when needed; there is already a test for that in
cmd/go/testdata/script/build_cwd_newline.txt.

Change-Id: Ie66d9c04ecc3c0f5950fc1111c74e1d01c67304c
Reviewed-on: https://go-review.googlesource.com/c/go/+/740742
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/cgo/gcc.go
src/cmd/cgo/main.go
src/cmd/cgo/out.go
src/cmd/cgo/util.go