aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Mirza Krak <mirza.krak@northern.tech>2019-06-10 17:40:07 +0200
committerGravatar Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>2019-06-10 20:44:08 +0200
commit60d455f20b9c656c2a23ce4e8dc03719e55f7453 (patch)
treef8353f8bae12acf0fab4951433d7b53a40e97f71
parent19ba3c56f51c0588d7d02d8d3be5cfa2872d1097 (diff)
downloadbuildroot-60d455f20b9c656c2a23ce4e8dc03719e55f7453.tar.gz
buildroot-60d455f20b9c656c2a23ce4e8dc03719e55f7453.tar.bz2
package/pkg-golang: do not set static linking for host target
The current logic will set the "-static" flag when building go host packages if BR2_STATIC_LIBS is set, this will not work as there is no support to link host packages statically. Fix this by applying this logic only for target builds. Signed-off-by: Mirza Krak <mirza.krak@northern.tech> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
-rw-r--r--package/pkg-golang.mk9
1 files changed, 5 insertions, 4 deletions
diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
index 72e8f6b7af..e47de17aba 100644
--- a/package/pkg-golang.mk
+++ b/package/pkg-golang.mk
@@ -58,10 +58,6 @@ define inner-golang-package
$(2)_WORKSPACE ?= _gopath
-ifeq ($(BR2_STATIC_LIBS),y)
-$(2)_LDFLAGS += -extldflags '-static'
-endif
-
$(2)_BUILD_OPTS += \
-ldflags "$$($(2)_LDFLAGS)" \
-tags "$$($(2)_TAGS)" \
@@ -106,6 +102,11 @@ endif
# file.
ifndef $(2)_BUILD_CMDS
ifeq ($(4),target)
+
+ifeq ($(BR2_STATIC_LIBS),y)
+$(2)_LDFLAGS += -extldflags '-static'
+endif
+
# Build package for target
define $(2)_BUILD_CMDS
$$(foreach d,$$($(2)_BUILD_TARGETS),\