Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 75C49E00D23; Wed, 28 Sep 2016 10:15:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [147.11.146.13 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 4863AE00D17 for ; Wed, 28 Sep 2016 10:14:57 -0700 (PDT) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id u8SHEuCD029073 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL) for ; Wed, 28 Sep 2016 10:14:56 -0700 (PDT) Received: from yow-dellw-ma.wrs.com (128.224.56.18) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.294.0; Wed, 28 Sep 2016 10:14:55 -0700 From: Mark Asselstine To: Date: Wed, 28 Sep 2016 13:14:54 -0400 Message-ID: <1475082894-18370-1-git-send-email-mark.asselstine@windriver.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Cc: meta-virtualization@yoctoproject.org Subject: [PATCH] containerd: use the target toolchain to build cgo components X-BeenThere: meta-virtualization@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Discussion of layer enabling hypervisor, virtualization tool stack, and cloud support" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2016 17:15:01 -0000 Content-Type: text/plain 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 --- 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