From: Matt Madison <matt@madison.systems> For architectures that support it, use the -linkshared build option to build packages against the shared Go runtime.
Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Otavio Salvador <ota...@ossystems.com.br> --- Changes in v9: - new patch 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 8d363e86a2..d805dc2713 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" -- 2.14.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core