diff --git a/package/kvm-unit-tests/Config.in b/package/kvm-unit-tests/Config.in index f77189601d..d72c734e78 100644 --- a/package/kvm-unit-tests/Config.in +++ b/package/kvm-unit-tests/Config.in @@ -1,5 +1,6 @@ config BR2_PACKAGE_KVM_UNIT_TESTS bool "kvm-unit-tests" + select BR2_HOSTARCH_NEEDS_IA32_COMPILER if BR2_x86_64=y depends on BR2_arm || BR2_i386 || BR2_powerpc64 || \ BR2_powerpc64le || BR2_x86_64 help diff --git a/package/kvm-unit-tests/kvm-unit-tests.mk b/package/kvm-unit-tests/kvm-unit-tests.mk index 7fd03add7d..1ace2e721a 100644 --- a/package/kvm-unit-tests/kvm-unit-tests.mk +++ b/package/kvm-unit-tests/kvm-unit-tests.mk @@ -28,9 +28,16 @@ endif KVM_UNIT_TESTS_CONF_OPTS =\ --arch="$(KERNEL_ARCH)" \ - --cross-prefix="$(TARGET_CROSS)" \ --endian="$(KVM_UNIT_TESTS_ENDIAN)" +# For all architectures but x86-64, we use the target +# compiler. However, for x86-64, we use the host compiler, as +# kvm-unit-tests builds 32 bit code, which Buildroot toolchains for +# x86-64 cannot do. +ifneq ($(BR2_x86_64),y) +KVM_UNIT_TESTS_CONF_OPTS += --cross-prefix="$(TARGET_CROSS)" +endif + define KVM_UNIT_TESTS_CONFIGURE_CMDS cd $(@D) && ./configure $(KVM_UNIT_TESTS_CONF_OPTS) endef