go.bbclass: Use external linker for native packages

Submitted by Khem Raj on Dec. 15, 2020, 8:49 a.m. | Patch ID: 178960


Message ID 20201215084956.2490265-1-raj.khem@gmail.com
State Accepted
Commit daf4856ea3ccafc05c808a34d4c6af2bfafea12f
Headers show

Commit Message

Khem Raj Dec. 15, 2020, 8:49 a.m.
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>
 meta/classes/go.bbclass | 1 +
 1 file changed, 1 insertion(+)

Links: You receive all messages sent to this group.
View/Reply Online (#145645): https://lists.openembedded.org/g/openembedded-core/message/145645
Mute This Topic: https://lists.openembedded.org/mt/78972426/1003190
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [mhalstead@linuxfoundation.org]

Patch hide | download patch | download mbox

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_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"