[gnome-continuous-yocto/gnomeostree-3.28-rocko: 7725/8267] go.bbclass: add support linking against shared runtime
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 7725/8267] go.bbclass: add support linking against shared runtime
- Date: Sun, 17 Dec 2017 06:39:04 +0000 (UTC)
commit 05c439a325e0a7637e9eec369adb77eaf9c32846
Author: Matt Madison <matt@madison.systems>
Date: Wed Sep 13 14:54:06 2017 -0300
go.bbclass: add support linking against shared runtime
For architectures that support it, use the -linkshared
build option to build packages against the shared Go
runtime.
(From OE-Core rev: 5624a773e4db3ad2251641e69b04dc380e74a4c7)
Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio ossystems com br>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
meta/classes/go.bbclass | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 8d363e8..d805dc2 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -31,7 +31,14 @@ DEPENDS_GOLANG_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk virtual/${
DEPENDS_append = " ${DEPENDS_GOLANG}"
-export GOBUILDFLAGS ?= "-v"
+GO_LINKSHARED ?= "${@'-linkshared' if d.getVar('GO_DYNLINK') else ''}"
+GO_RPATH_LINK = "${@'-Wl,-rpath-link=${STAGING_DIR_TARGET}${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink' if
d.getVar('GO_DYNLINK') else ''}"
+GO_RPATH = "${@'-r ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}"
+GO_RPATH_class-native = "${@'-r ${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE}_dynlink' if
d.getVar('GO_DYNLINK') else ''}"
+GO_RPATH_LINK_class-native = "${@'-Wl,-rpath-link=${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE}_dynlink'
if d.getVar('GO_DYNLINK') else ''}"
+GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${GO_RPATH_LINK} ${LDFLAGS}"
+GO_LDFLAGS ?= '-ldflags="${GO_RPATH} -extldflags '${GO_EXTLDFLAGS}'"'
+export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}"
GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
export GO = "${HOST_PREFIX}go"
@@ -81,7 +88,7 @@ go_do_configure() {
go_do_compile() {
${GO} env
if [ -n "${GO_INSTALL}" ]; then
- ${GO} install ${GOBUILDFLAGS} `go_list_packages`
+ ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages`
fi
}
do_compile[cleandirs] = "${B}/bin ${B}/pkg"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]