Skip to contentSkip to conversation

go.bbclass: Use external linker for native packages

PATCH New Khem Raj 1 participant 1 message Dec 15, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 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

Cc Otavio Salvador <[email protected]>
Cc Konrad Weihmann <[email protected]>
---
 meta/classes/go.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/go.bbclass +1 -0
index a9e31b50ea..5b26378a4e 100644
@@ -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"
Signature · 1 line
2.29.2