summaryrefslogtreecommitdiff
path: root/package/kvm-unit-tests
diff options
context:
space:
mode:
authorCyril Bur <cyrilbur@gmail.com>2016-10-26 14:19:15 +1100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-10-26 12:33:31 +0200
commite1b344070c607f9a3f0a7004650f00c9e6e83c7b (patch)
tree21f83b721f9d7d92439347c0b174c635bc97d055 /package/kvm-unit-tests
parent76e10967e1fbf2ff28dd70df5e0e8970542ca7df (diff)
kvm-unit-tests: Fix x86_64 to use host compiler
kvm-unit-tests requires a multilib compiler for x86_64 as it compiles 32bit boot code. This patch uses the BR2_HOSTARCH_NEEDS_IA32_COMPILER option to enforce this and avoids using TARGET_CROSS for x86_64 targets and uses the host 32bit (and 64bit) capable compiler. Signed-off-by: Cyril Bur <cyrilbur@gmail.com> [Thomas: reword comment in .mk file.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/kvm-unit-tests')
-rw-r--r--package/kvm-unit-tests/Config.in1
-rw-r--r--package/kvm-unit-tests/kvm-unit-tests.mk9
2 files changed, 9 insertions, 1 deletions
diff --git a/package/kvm-unit-tests/Config.in b/package/kvm-unit-tests/Config.in
index f77189601..d72c734e7 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 7fd03add7..1ace2e721 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