summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-12-15 00:49:56 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-18 22:52:13 +0000
commitdaf4856ea3ccafc05c808a34d4c6af2bfafea12f (patch)
tree5e7729bf01516b003756a65f032930ce4f7364ee
parentd39b686cc5fcc89405ffeb560ea64b5d305b0608 (diff)
downloadopenembedded-core-contrib-daf4856ea3ccafc05c808a34d4c6af2bfafea12f.tar.gz
go.bbclass: Use external linker for native packages
go 1.15 has reworked internal linker, which has resulted in regressions in OE where native binaries generated using internal linker in some cases result in corruption during populate_sysroot e.g. glide-native crashing when used after relocation. This improved reliability of native binaries working especially when they use cgo or pie build modes Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Otavio Salvador <otavio.salvador@ossystems.com.br> Cc: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/go.bbclass1
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index a9e31b50ea..5b26378a4e 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -40,6 +40,7 @@ GO_RPATH_LINK_class-native = "${@'-Wl,-rpath-link=${STAGING_LIBDIR_NATIVE}/go/pk
GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${GO_RPATH_LINK} ${LDFLAGS}"
GO_LINKMODE ?= ""
GO_LINKMODE_class-nativesdk = "--linkmode=external"
+GO_LINKMODE_class-native = "--linkmode=external"
GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"'
export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS} -trimpath"
export GOPATH_OMIT_IN_ACTIONID ?= "1"