[oe-commits] [openembedded-core] 05/12: go.bbclass: add support linking against shared runtime

git at git.openembedded.org git at git.openembedded.org
Wed Sep 13 21:21:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 5624a773e4db3ad2251641e69b04dc380e74a4c7
Author: Matt Madison <matt at madison.systems>
AuthorDate: 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.
    
    Signed-off-by: Matt Madison <matt at madison.systems>
    Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/go.bbclass | 11 +++++++++--
 1 file 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"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list