From dbd6f224c38367fb3a26b1ed0b76dd5e284a98a7 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Sun, 29 Dec 2019 18:43:01 +0800 Subject: [PATCH] golang: Format TARGET_LDFLAGS for gcc go invokes the external linker by calling gcc, so -zxxx options in TARGET_LDFLAGS (in golang-package.mk) need to be formatted as -Wl,z,xxx. Signed-off-by: Jeffery To --- lang/golang/golang-package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/golang/golang-package.mk b/lang/golang/golang-package.mk index c6ad7f70f..db700ee89 100644 --- a/lang/golang/golang-package.mk +++ b/lang/golang/golang-package.mk @@ -275,7 +275,7 @@ define GoPackage/Build/Compile mips|mipsle) installsuffix="$(GO_MIPS)" ;; \ mips64|mips64le) installsuffix="$(GO_MIPS64)" ;; \ esac ; \ - ldflags="-linkmode external -extldflags '$(TARGET_LDFLAGS)'" ; \ + ldflags="-linkmode external -extldflags '$(TARGET_LDFLAGS:-z%=-Wl,-z,%)'" ; \ pkg_gcflags="$(GO_PKG_GCFLAGS)" ; \ pkg_ldflags="$(GO_PKG_LDFLAGS)" ; \ for def in $(GO_PKG_LDFLAGS_X); do \