From f76779f7ef6636355a5aa5741a736f5234a67fdb Mon Sep 17 00:00:00 2001 From: Matt Madison Date: Thu, 14 Sep 2017 16:22:28 -0300 Subject: go: fix linking issues for nativesdk builds Switch to using an external linker for nativesdk go, go-runtime, and go package builds, which works more reliably when building 32-bit SDKs. Signed-off-by: Matt Madison Signed-off-by: Otavio Salvador Signed-off-by: Ross Burton --- meta/recipes-devtools/go/go-runtime.inc | 5 +++++ meta/recipes-devtools/go/go-target.inc | 3 +++ 2 files changed, 8 insertions(+) (limited to 'meta/recipes-devtools') diff --git a/meta/recipes-devtools/go/go-runtime.inc b/meta/recipes-devtools/go/go-runtime.inc index a074238e47..934d1aaeb9 100644 --- a/meta/recipes-devtools/go/go-runtime.inc +++ b/meta/recipes-devtools/go/go-runtime.inc @@ -45,6 +45,11 @@ do_install() { done } +# Remove test binaries that cannot be relocated +do_install_append_class-nativesdk() { + rm -rf ${D}${libdir}/go/src/runtime/pprof/testdata +} + # These testdata directories aren't needed for builds and contain binaries # that can cause errors in sysroot_strip(), so just remove them. sysroot_stage_all_append() { diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc index 0d80bf0d97..b88d0166e5 100644 --- a/meta/recipes-devtools/go/go-target.inc +++ b/meta/recipes-devtools/go/go-target.inc @@ -14,6 +14,9 @@ export CC_FOR_TARGET = "${CC}" export CXX_FOR_TARGET = "${CXX}" export GO_TARGET_INSTALL = "cmd" export GO_FLAGS = "-a" +GO_LDFLAGS = "" +GO_LDFLAGS_class-nativesdk = "-linkmode external" +export GO_LDFLAGS do_configure[noexec] = "1" -- cgit v1.2.3