aboutsummaryrefslogtreecommitdiff
path: root/lang/golang/golang-package.mk
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2019-09-13 17:28:42 +0800
committerJeffery To <jeffery.to@gmail.com>2019-09-13 17:48:40 +0800
commit22ee6e86a08d1e59608c50495d25e49378174e5a (patch)
tree1fd3cb1007b71eda4d21dfa5f4ea3d7ab1074a5d /lang/golang/golang-package.mk
parenta1057cea1fb895a732a6854f79d53a763c722ef7 (diff)
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>
Diffstat (limited to 'lang/golang/golang-package.mk')
-rw-r--r--lang/golang/golang-package.mk4
1 files changed, 1 insertions, 3 deletions
diff --git a/lang/golang/golang-package.mk b/lang/golang/golang-package.mk
index d1d189eb5..172b77897 100644
--- a/lang/golang/golang-package.mk
+++ b/lang/golang/golang-package.mk
@@ -275,7 +275,6 @@ define GoPackage/Build/Compile
mips|mipsle) installsuffix="$(GO_MIPS)" ;; \
mips64|mips64le) installsuffix="$(GO_MIPS64)" ;; \
esac ; \
- trimpath="all=-trimpath=$(GO_PKG_BUILD_DIR)" ; \
ldflags="all=-linkmode external -extldflags '$(TARGET_LDFLAGS)'" ; \
pkg_gcflags="$(GO_PKG_GCFLAGS)" ; \
pkg_ldflags="$(GO_PKG_LDFLAGS)" ; \
@@ -284,8 +283,7 @@ define GoPackage/Build/Compile
done ; \
go install \
$$$${installsuffix:+-installsuffix $$$$installsuffix} \
- -gcflags "$$$$trimpath" \
- -asmflags "$$$$trimpath" \
+ -trimpath \
-ldflags "$$$$ldflags" \
-v \
$$$${pkg_gcflags:+-gcflags "$$$$pkg_gcflags"} \