aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Madison <matt@madison.systems>2017-09-13 14:54:05 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-13 22:12:19 +0100
commitf562b5e91c12ab67140de537ea269fe1ac85a764 (patch)
tree65d143849ff113bbad7b0060f54e6c583bf4f1aa
parent24c2ac446296663b86160cac046e7faccb19f5af (diff)
downloadopenembedded-core-f562b5e91c12ab67140de537ea269fe1ac85a764.zip
openembedded-core-f562b5e91c12ab67140de537ea269fe1ac85a764.tar.gz
openembedded-core-f562b5e91c12ab67140de537ea269fe1ac85a764.tar.bz2
go-runtime: build the Go runtime as a shared library
If the target architecture supports, it build the Go runtime as a shared library in addition to building the static libraries. 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>
-rw-r--r--meta/recipes-devtools/go/go-runtime.inc24
1 files changed, 22 insertions, 2 deletions
diff --git a/meta/recipes-devtools/go/go-runtime.inc b/meta/recipes-devtools/go/go-runtime.inc
index 3775e86..a074238 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -24,6 +24,9 @@ do_compile() {
mkdir ${GOBIN}
cd src
GO_FLAGS="" ./make.bash
+ if [ -n "${GO_DYNLINK}" ]; then
+ GO_FLAGS="-buildmode=shared" GO_LDFLAGS="-extldflags \"${LDFLAGS}\"" ./make.bash
+ fi
cd ${B}
}
@@ -49,8 +52,25 @@ sysroot_stage_all_append() {
}
ALLOW_EMPTY_${PN} = "1"
-FILES_${PN}-dev = "${libdir}/go/src ${libdir}/go/pkg/include"
-FILES_${PN}-staticdev = "${libdir}/go/pkg/${TARGET_GOTUPLE} ${libdir}/go/pkg/${TARGET_GOTUPLE}"
+FILES_${PN} = "${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*${SOLIBSDEV}"
+FILES_${PN}-dev = "${libdir}/go/src ${libdir}/go/pkg/include \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.shlibname \
+"
+FILES_${PN}-staticdev = "${libdir}/go/pkg/${TARGET_GOTUPLE} \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.a \
+"
# The testdata directories in the source tree include some binaries for various
# architectures, scripts, and .a files
INSANE_SKIP_${PN}-dev = "staticdev ldflags file-rdeps arch"