All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] vboot-utils: fix ARCH detection
@ 2017-11-06 19:06 Alex Suykov
  2017-11-06 20:46 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Suykov @ 2017-11-06 19:06 UTC (permalink / raw)
  To: buildroot

The package includes some target-specific code that is irrelevant
in a host package but gets built anyway. The target for this code
must be one of the supported ChromeOS targets.

Supplied Makefile apparently relies on the environment to provide
a valid target, with a simple fallback to host arch. This breaks
the build if no value is provided and the host arch is not among
the supported ones.

Should fix
http://autobuild.buildroot.net/results/d118a83b6c4f7f910d0d44c279f36251d7ba29e8/
and similar failures.

Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
---
 package/vboot-utils/Config.in.host | 1 +
 package/vboot-utils/vboot-utils.mk | 1 +
 2 files changed, 2 insertions(+)

diff --git a/package/vboot-utils/Config.in.host b/package/vboot-utils/Config.in.host
index aa0caef2e2..1b23e1c644 100644
--- a/package/vboot-utils/Config.in.host
+++ b/package/vboot-utils/Config.in.host
@@ -1,6 +1,7 @@
 config BR2_PACKAGE_HOST_VBOOT_UTILS
 	bool "host vboot utils"
 	select BR2_PACKAGE_HOST_UTIL_LINUX
+	depends on BR2_arm || BR2_x86_64 || BR2_i386
 	help
 	  Chromium OS verified boot utilities: futility and cgpt.
 
diff --git a/package/vboot-utils/vboot-utils.mk b/package/vboot-utils/vboot-utils.mk
index a6a67ad317..bfbd6d204a 100644
--- a/package/vboot-utils/vboot-utils.mk
+++ b/package/vboot-utils/vboot-utils.mk
@@ -27,6 +27,7 @@ define HOST_VBOOT_UTILS_BUILD_CMDS
 		CC="$(HOSTCC)" \
 		CFLAGS="$(HOST_CFLAGS) -D_LARGEFILE64_SOURCE -D_GNU_SOURCE" \
 		LDFLAGS="$(HOST_LDFLAGS)" \
+		ARCH=$(BR2_ARCH) \
 		futil cgpt
 endef
 
-- 
2.14.1

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

* [Buildroot] [PATCH] vboot-utils: fix ARCH detection
  2017-11-06 19:06 [Buildroot] [PATCH] vboot-utils: fix ARCH detection Alex Suykov
@ 2017-11-06 20:46 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2017-11-06 20:46 UTC (permalink / raw)
  To: buildroot

Hello,

Thanks for coming up with a fix for this. See below for some comments.

On Mon, 6 Nov 2017 21:06:11 +0200, Alex Suykov wrote:
> The package includes some target-specific code that is irrelevant
> in a host package but gets built anyway. The target for this code
> must be one of the supported ChromeOS targets.
> 
> Supplied Makefile apparently relies on the environment to provide
> a valid target, with a simple fallback to host arch. This breaks
> the build if no value is provided and the host arch is not among
> the supported ones.
> 
> Should fix
> http://autobuild.buildroot.net/results/d118a83b6c4f7f910d0d44c279f36251d7ba29e8/
> and similar failures.
> 
> Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
> ---
>  package/vboot-utils/Config.in.host | 1 +
>  package/vboot-utils/vboot-utils.mk | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/package/vboot-utils/Config.in.host b/package/vboot-utils/Config.in.host
> index aa0caef2e2..1b23e1c644 100644
> --- a/package/vboot-utils/Config.in.host
> +++ b/package/vboot-utils/Config.in.host
> @@ -1,6 +1,7 @@
>  config BR2_PACKAGE_HOST_VBOOT_UTILS
>  	bool "host vboot utils"
>  	select BR2_PACKAGE_HOST_UTIL_LINUX
> +	depends on BR2_arm || BR2_x86_64 || BR2_i386

A comment on top of this dependency would be nice, because it is very,
very weird to have target architecture dependencies on a host package.

> diff --git a/package/vboot-utils/vboot-utils.mk b/package/vboot-utils/vboot-utils.mk
> index a6a67ad317..bfbd6d204a 100644
> --- a/package/vboot-utils/vboot-utils.mk
> +++ b/package/vboot-utils/vboot-utils.mk
> @@ -27,6 +27,7 @@ define HOST_VBOOT_UTILS_BUILD_CMDS
>  		CC="$(HOSTCC)" \
>  		CFLAGS="$(HOST_CFLAGS) -D_LARGEFILE64_SOURCE -D_GNU_SOURCE" \
>  		LDFLAGS="$(HOST_LDFLAGS)" \
> +		ARCH=$(BR2_ARCH) \

The Makefile only understands i386, but BR2_ARCH will be potentially
equal to i486, i586 or i686. So we need 

Also, as I told you in my e-mail, it seems that if HOST_ARCH != ARCH,
vboot-utils will try to use Qemu. Did you try to build with ARM as a
target architecture, on a x86_64 machine for example ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

end of thread, other threads:[~2017-11-06 20:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-06 19:06 [Buildroot] [PATCH] vboot-utils: fix ARCH detection Alex Suykov
2017-11-06 20:46 ` Thomas Petazzoni

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.