diff mbox series

[1/4] kvm-unit-test: x86-64 variant only available on x86-64 hosts

Message ID 20171102104520.29257-2-peter@korsgaard.com
State Accepted
Headers show
Series Fix BR2_HOSTARCH_NEEDS_IA32_* autobuilder issues | expand

Commit Message

Peter Korsgaard Nov. 2, 2017, 10:45 a.m. UTC
We use the host compiler for x86-64 builds, so ensure it is only available
on x86-64 hosts.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/kvm-unit-tests/Config.in | 1 +
 1 file changed, 1 insertion(+)

Comments

Arnout Vandecappelle Nov. 5, 2017, 3:44 p.m. UTC | #1
On 02-11-17 11:45, Peter Korsgaard wrote:
> We use the host compiler for x86-64 builds, so ensure it is only available
> on x86-64 hosts.
> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
>  package/kvm-unit-tests/Config.in | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/kvm-unit-tests/Config.in b/package/kvm-unit-tests/Config.in
> index d0d9e2ef96..8b7908eee9 100644
> --- a/package/kvm-unit-tests/Config.in
> +++ b/package/kvm-unit-tests/Config.in
> @@ -15,6 +15,7 @@ config BR2_PACKAGE_KVM_UNIT_TESTS
>  	# x86-64 we use the host gcc (see .mk file for details)
>  	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_5 || !BR2_i386
>  	depends on BR2_HOST_GCC_AT_LEAST_4_5 || !BR2_x86_64
> +	depends on BR2_HOSTARCH = "x86_64" || !BR2_x86_64

 I don't think this is correct: it will also build correctly for x86_64 if the
host is i386, because it uses -m32 (which is the reason to use the host compiler
instead of the target compiler).

 Regards,
 Arnout

>  	select BR2_HOSTARCH_NEEDS_IA32_COMPILER if BR2_x86_64=y
>  	help
>  	  kvm-unit-tests is a project as old as KVM. As its name
>
Peter Korsgaard Nov. 5, 2017, 7:27 p.m. UTC | #2
>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

 > On 02-11-17 11:45, Peter Korsgaard wrote:
 >> We use the host compiler for x86-64 builds, so ensure it is only available
 >> on x86-64 hosts.
 >> 
 >> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
 >> ---
 >> package/kvm-unit-tests/Config.in | 1 +
 >> 1 file changed, 1 insertion(+)
 >> 
 >> diff --git a/package/kvm-unit-tests/Config.in b/package/kvm-unit-tests/Config.in
 >> index d0d9e2ef96..8b7908eee9 100644
 >> --- a/package/kvm-unit-tests/Config.in
 >> +++ b/package/kvm-unit-tests/Config.in
 >> @@ -15,6 +15,7 @@ config BR2_PACKAGE_KVM_UNIT_TESTS
 >> # x86-64 we use the host gcc (see .mk file for details)
 >> depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_5 || !BR2_i386
 >> depends on BR2_HOST_GCC_AT_LEAST_4_5 || !BR2_x86_64
 >> +	depends on BR2_HOSTARCH = "x86_64" || !BR2_x86_64

 >  I don't think this is correct: it will also build correctly for x86_64 if the
 > host is i386, because it uses -m32 (which is the reason to use the host compiler
 > instead of the target compiler).

But some parts of kvm-unit-tests presumably are 64bit when building for
x86-64, which wouldn't work when using the host compiler on a x86
system, right? I don't think x86 system compilers are 32/64bit multilib.

But I haven't actually used a x86 distribution in the last 10 years or
so, so perhaps I'm missing something?
Arnout Vandecappelle Nov. 5, 2017, 8:23 p.m. UTC | #3
On 05-11-17 20:27, Peter Korsgaard wrote:
>>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
> 
>  > On 02-11-17 11:45, Peter Korsgaard wrote:
>  >> We use the host compiler for x86-64 builds, so ensure it is only available
>  >> on x86-64 hosts.
>  >> 
>  >> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
>  >> ---
>  >> package/kvm-unit-tests/Config.in | 1 +
>  >> 1 file changed, 1 insertion(+)
>  >> 
>  >> diff --git a/package/kvm-unit-tests/Config.in b/package/kvm-unit-tests/Config.in
>  >> index d0d9e2ef96..8b7908eee9 100644
>  >> --- a/package/kvm-unit-tests/Config.in
>  >> +++ b/package/kvm-unit-tests/Config.in
>  >> @@ -15,6 +15,7 @@ config BR2_PACKAGE_KVM_UNIT_TESTS
>  >> # x86-64 we use the host gcc (see .mk file for details)
>  >> depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_5 || !BR2_i386
>  >> depends on BR2_HOST_GCC_AT_LEAST_4_5 || !BR2_x86_64
>  >> +	depends on BR2_HOSTARCH = "x86_64" || !BR2_x86_64
> 
>  >  I don't think this is correct: it will also build correctly for x86_64 if the
>  > host is i386, because it uses -m32 (which is the reason to use the host compiler
>  > instead of the target compiler).
> 
> But some parts of kvm-unit-tests presumably are 64bit when building for
> x86-64, 

 OK, I assumed everything was built with -m32. If some parts are indeed still
64-bit then it won't work in i386 host.

> which wouldn't work when using the host compiler on a x86
> system, right? I don't think x86 system compilers are 32/64bit multilib

 Actually, on Debian i386 it is possible to install 64-bit multilib I think. But
obviously we can't count on that.

 BTW, what happens on x32, does anybody know that?

> But I haven't actually used a x86 distribution in the last 10 years or
> so, so perhaps I'm missing something?

 Yeah, it's pretty unlikely as well I guess.

 I'll apply this patch as well then.

 Regards,
 Arnout
Peter Korsgaard Nov. 5, 2017, 8:34 p.m. UTC | #4
>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

Hi,

 >> But some parts of kvm-unit-tests presumably are 64bit when building for
 >> x86-64, 

 >  OK, I assumed everything was built with -m32. If some parts are indeed still
 > 64-bit then it won't work in i386 host.

Exactly.

 >> which wouldn't work when using the host compiler on a x86
 >> system, right? I don't think x86 system compilers are 32/64bit multilib

 >  Actually, on Debian i386 it is possible to install 64-bit multilib I think. But
 > obviously we can't count on that.

 >  BTW, what happens on x32, does anybody know that?

Is x32 really used by any mainstream distro? I would guess it is as rare
as building on a !x86 machine.


 >> But I haven't actually used a x86 distribution in the last 10 years or
 >> so, so perhaps I'm missing something?

 >  Yeah, it's pretty unlikely as well I guess.

 >  I'll apply this patch as well then.

Great, thanks!
Peter Korsgaard Nov. 26, 2017, 8:33 p.m. UTC | #5
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:

 > We use the host compiler for x86-64 builds, so ensure it is only available
 > on x86-64 hosts.

 > Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

Committed to 2017.08.x, thanks.
diff mbox series

Patch

diff --git a/package/kvm-unit-tests/Config.in b/package/kvm-unit-tests/Config.in
index d0d9e2ef96..8b7908eee9 100644
--- a/package/kvm-unit-tests/Config.in
+++ b/package/kvm-unit-tests/Config.in
@@ -15,6 +15,7 @@  config BR2_PACKAGE_KVM_UNIT_TESTS
 	# x86-64 we use the host gcc (see .mk file for details)
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_5 || !BR2_i386
 	depends on BR2_HOST_GCC_AT_LEAST_4_5 || !BR2_x86_64
+	depends on BR2_HOSTARCH = "x86_64" || !BR2_x86_64
 	select BR2_HOSTARCH_NEEDS_IA32_COMPILER if BR2_x86_64=y
 	help
 	  kvm-unit-tests is a project as old as KVM. As its name