All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] docker/containerd: Export GOARCH to fix build in arm64
@ 2017-10-06 17:32 Aníbal Limón
  2017-10-09 16:39 ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Aníbal Limón @ 2017-10-06 17:32 UTC (permalink / raw)
  To: meta-virtualization; +Cc: nicolas.dechesne, Aníbal Limón

From: Aníbal Limón <anibal.limon@linaro.org>

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>
---
 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 18d9188..e7a3719 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 4d6c17c..d2dce76 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}"
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] docker/containerd: Export GOARCH to fix build in arm64
  2017-10-06 17:32 [PATCH] docker/containerd: Export GOARCH to fix build in arm64 Aníbal Limón
@ 2017-10-09 16:39 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2017-10-09 16:39 UTC (permalink / raw)
  To: Aníbal Limón
  Cc: nicolas.dechesne, meta-virtualization, Aníbal Limón

merged.

Bruce

On Fri, Oct 6, 2017 at 1:32 PM, Aníbal Limón <limon.anibal@gmail.com> wrote:
> From: Aníbal Limón <anibal.limon@linaro.org>
>
> 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>
> ---
>  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 18d9188..e7a3719 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 4d6c17c..d2dce76 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}"
> --
> 2.11.0
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-09 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 17:32 [PATCH] docker/containerd: Export GOARCH to fix build in arm64 Aníbal Limón
2017-10-09 16:39 ` Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.