golang: Use new -trimpath option when compiling Go packages

Go 1.13 added a new -trimpath option to the "go build" command[1] that
removes system paths from compiled executables. This replaces the
previous -trimpath flags.

There are still system paths in the compiled executable (for crti.o and
crtn.o, when cross-compiling); these appear to be stripped during the
packaging process.

[1]: https://golang.org/doc/go1.13#trimpath

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
Jeffery To
2019-09-13 17:28:42 +08:00
parent a1057cea1f
commit 22ee6e86a0
2 changed files with 2 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ unexport \
CC_FOR_TARGET CXX_FOR_TARGET GO_DISTFLAGS GO_GCFLAGS GO_LDFLAGS GOBUILDTIMELOGFILE GOROOT_BOOTSTRAP \
BOOT_GO_GCFLAGS GOEXPERIMENT GOBOOTSTRAP_TOOLEXEC
# there are more magic environment variables to track down, but ain't nobody got time for that
# deliberately left untouched: GOPROXY GONOPROXY GOSUMDB GONOSUMDB GOPRIVATE
go_arch=$(subst \
aarch64,arm64,$(subst \