]> Cypherpunks repositories - gostls13.git/commit
cmd/go: support cgo files in overlays
authorMichael Matloob <matloob@golang.org>
Mon, 2 Nov 2020 19:19:12 +0000 (19:19 +0000)
committerMichael Matloob <matloob@golang.org>
Mon, 2 Nov 2020 21:00:57 +0000 (21:00 +0000)
commitd1efaed17a7a4bf4b2dd8a8f975069dfd8251ca4
treec1a819604b940f8d43fafe762c6afde36665c2d4
parent05e6d28849293266028c0bc9e9b0f8d0da38a2e2
cmd/go: support cgo files in overlays

This is a roll-forward of golang.org/cl/262618, which was reverted in
golang.org/cl/267037. The only differences between this CL and the
original are the three calls to fflush from the C files in
build_overlay.txt, to guarantee that the string we're expecting is
actually written out.

This requires rewriting the paths of the files passed to the cgo tool
toolchain to use the overlaid paths instead of the disk paths of
files. Because the directories of the overlaid paths don't exist in
general, the cgo tool have been updated to run in base.Cwd instead of
the package directory.

For #39958

Change-Id: If7e5e057c62c0c22ddb724f9fe650902fc5f4832
Reviewed-on: https://go-review.googlesource.com/c/go/+/267197
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Michael Matloob <matloob@golang.org>
src/cmd/go/internal/work/exec.go
src/cmd/go/internal/work/gc.go
src/cmd/go/testdata/script/build_overlay.txt
src/cmd/go/testdata/script/build_trimpath_cgo.txt