]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go: pass in overlaid file paths to C compiler
authorMichael Matloob <matloob@golang.org>
Thu, 29 Oct 2020 23:05:56 +0000 (19:05 -0400)
committerMichael Matloob <matloob@golang.org>
Thu, 12 Nov 2020 21:21:18 +0000 (21:21 +0000)
commit60b12532932fe40a8d756619474a00f820faacc8
tree76fb86eafacd4765c5de7d68a66dcf65af6573f6
parent062e0e5ce6df339dc26732438ad771f73dbf2292
cmd/go: pass in overlaid file paths to C compiler

This change moves the code in work.(*Builder).cgo that, when there is
an overlay, copies non-Go files to objdir into work.(*Builder).Build,
and creates an overlay structure mapping from the nominal file paths
into the copies in objdir. That's propagated through to
work.(*Builder).ccompile, which will use it to pass in the path to the
overlaid contents in objdir when calling the compiler.

This allows for overlays of C/C++/Fortran files.

For #39958

Change-Id: I9a2e3d3ba6afdf7ce19be1dbf4eee34805cdc05f
Reviewed-on: https://go-review.googlesource.com/c/go/+/266376
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/work/action.go
src/cmd/go/internal/work/exec.go
src/cmd/go/testdata/script/build_overlay.txt