docker/containerd: Export GOARCH to fix build in arm64

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 <anibal.limon@linaro.org>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
Aníbal Limón 2017-10-06 12:25:48 -05:00 committed by Bruce Ashfield
parent 1f99ba19c8
commit 89a1121656
2 changed files with 2 additions and 0 deletions

View File

@ -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=""

View File

@ -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}"