]> code.ossystems Code Review - openembedded-core.git/commitdiff
go.bbclass: Use external linker for native packages
authorKhem Raj <raj.khem@gmail.com>
Tue, 15 Dec 2020 08:49:56 +0000 (00:49 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 18 Dec 2020 22:52:13 +0000 (22:52 +0000)
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>
meta/classes/go.bbclass

index a9e31b50ea5fb5b4c118e1dc43ec5294fc6c1975..5b26378a4ea1cd701eddb2b0aeccfeeb920d35bb 100644 (file)
@@ -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"