Skip to contentSkip to conversation

containerd: use the target toolchain to build cgo components

PATCH New Mark Asselstine 1 participant 1 message Sep 28, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 containerd: use the target toolchain to build cgo components

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.

---

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(+)
recipes-containers/containerd/containerd_git.bb +2 -0
index 24a51bc..ca99e55 100644
@@ -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
 }
Signature · 1 line
2.7.4