[meta-virtualization] [PATCH] containerd: use the target toolchain to build cgo components

Mark Asselstine mark.asselstine at windriver.com
Wed Sep 28 10:14:54 PDT 2016


We need to ensure we are using the target toolchain and sysroot to
avoid possible host contamination, and in the case of non x86-64
target builds, allow the build to complete successfully.

Signed-off-by: Mark Asselstine <mark.asselstine at windriver.com>
---

Build tested with qemuarm, intel-corei7-64 and qemux86-64, runtime
tested with qemuarm and qemux86-64 (with the changes from Jason which
he will be sending out shortly).


 recipes-containers/containerd/containerd_git.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/recipes-containers/containerd/containerd_git.bb b/recipes-containers/containerd/containerd_git.bb
index 24a51bc..ca99e55 100644
--- a/recipes-containers/containerd/containerd_git.bb
+++ b/recipes-containers/containerd/containerd_git.bb
@@ -53,6 +53,8 @@ do_compile() {
 	export LDFLAGS=""
 	export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 	export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+	export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+	export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
 
         oe_runmake static
 }
-- 
2.7.4



More information about the meta-virtualization mailing list