From 89a1121656aaf04966b79756c6967f7a5ada02d5 Mon Sep 17 00:00:00 2001 From: Aníbal Limón Date: Fri, 6 Oct 2017 12:25:48 -0500 Subject: docker/containerd: Export GOARCH to fix build in arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the GOARCH isn't set CGO took the ARCH from the host and tries to use -m64 flag that isn't available in aarch64 compiler. ... | # github.com/opencontainers/runc/libcontainer/system | aarch64-linaro-linux-gcc: error: unrecognized command line option '-m64' | # github.com/containerd/console | aarch64-linaro-linux-gcc: error: unrecognized command line option '-m64' | Makefile:60: recipe for target 'shim-static' failed ... Signed-off-by: Aníbal Limón Signed-off-by: Bruce Ashfield --- recipes-containers/containerd/containerd.inc | 1 + recipes-containers/docker/docker_git.bb | 1 + 2 files changed, 2 insertions(+) diff --git a/recipes-containers/containerd/containerd.inc b/recipes-containers/containerd/containerd.inc index 18d9188e..e7a37192 100644 --- a/recipes-containers/containerd/containerd.inc +++ b/recipes-containers/containerd/containerd.inc @@ -38,6 +38,7 @@ do_compile() { # Pass the needed cflags/ldflags so that cgo # can find the needed headers files and libraries + export GOARCH="${TARGET_GOARCH}" export CGO_ENABLED="1" export CFLAGS="" export LDFLAGS="" diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb index 4d6c17c9..4ba5e817 100644 --- a/recipes-containers/docker/docker_git.bb +++ b/recipes-containers/docker/docker_git.bb @@ -97,6 +97,7 @@ do_compile() { # Pass the needed cflags/ldflags so that cgo # can find the needed headers files and libraries + export GOARCH=${TARGET_GOARCH} export CGO_ENABLED="1" export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" -- cgit v1.2.3-54-g00ecf