]> Cypherpunks repositories - gostls13.git/commit
cmd/go: trim source paths when compiling C with -trimpath
authorJay Conrod <jayconrod@google.com>
Thu, 19 Dec 2019 18:43:24 +0000 (13:43 -0500)
committerJay Conrod <jayconrod@google.com>
Wed, 29 Apr 2020 19:03:10 +0000 (19:03 +0000)
commit35dce1d67c730a0f49c82660e94fe8305cac6861
tree54f74a651461478c733c2c637decdd1c8ee19fcd
parent5a550b695117f07a4f2454039a4871250cd3ed09
cmd/go: trim source paths when compiling C with -trimpath

When then go command is run with -trimpath, it will now use
-fdebug-prefix-map when invoking the C compiler (if supported) to
replace the source root directory with a dummy root directory.

This should prevent source directories from appearing either literally
or in compressed DWARF in linked binaries.

Updates #36072

Change-Id: Iedd08d5e886f81e981f11248a1be4ed4f58bdd29
Reviewed-on: https://go-review.googlesource.com/c/go/+/212101
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/work/exec.go
src/cmd/go/internal/work/gc.go
src/cmd/go/testdata/script/build_trimpath_cgo.txt [new file with mode: 0644]