diff options
3 files changed, 103 insertions, 0 deletions
diff --git a/recipes-extended/xvisor/files/0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch b/recipes-extended/xvisor/files/0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch new file mode 100644 index 00000000..2e53943f --- /dev/null +++ b/recipes-extended/xvisor/files/0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 022c885d077dce6fad3eca5fd2f54b2070c375d2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Fri, 17 May 2019 14:21:44 -0700 | ||
4 | Subject: [PATCH] TESTS: Don't specify mabi or march for RISC-V | ||
5 | |||
6 | To avoid | ||
7 | can't link double-float modules with soft-float modules | ||
8 | errors when building 32-bit baremetal guests don't specify mabi | ||
9 | or march. | ||
10 | |||
11 | Upstream-Status: Inappropriate [Fixes a 32-bit Yocto flow bug] | ||
12 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
13 | --- | ||
14 | tests/riscv/common/basic/Makefile.inc | 4 ++-- | ||
15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/tests/riscv/common/basic/Makefile.inc b/tests/riscv/common/basic/Makefile.inc | ||
18 | index 9fa5abed..f3ff1864 100644 | ||
19 | --- a/tests/riscv/common/basic/Makefile.inc | ||
20 | +++ b/tests/riscv/common/basic/Makefile.inc | ||
21 | @@ -24,8 +24,8 @@ | ||
22 | ARCH_CPPFLAGS=$(board_cppflags) -DFIRMWARE_BOOT | ||
23 | ARCH_CPPFLAGS+=-DTEXT_START=$(board_text_start) | ||
24 | ifeq ($(board_32bit),y) | ||
25 | -ARCH_CFLAGS=$(board_cflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mabi=ilp32 -march=rv32imafdc -mcmodel=medany | ||
26 | -ARCH_ASFLAGS=$(board_asflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mabi=ilp32 -march=rv32imafdc -mcmodel=medany | ||
27 | +ARCH_CFLAGS=$(board_cflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mcmodel=medany | ||
28 | +ARCH_ASFLAGS=$(board_asflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mcmodel=medany | ||
29 | else | ||
30 | ARCH_CFLAGS=$(board_cflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mabi=lp64 -march=rv64imafdc -mcmodel=medany | ||
31 | ARCH_ASFLAGS=$(board_asflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mabi=lp64 -march=rv64imafdc -mcmodel=medany | ||
32 | -- | ||
33 | 2.21.0 | ||
34 | |||
diff --git a/recipes-extended/xvisor/xvisor-configs.inc b/recipes-extended/xvisor/xvisor-configs.inc new file mode 100644 index 00000000..099128dd --- /dev/null +++ b/recipes-extended/xvisor/xvisor-configs.inc | |||
@@ -0,0 +1,25 @@ | |||
1 | def get_oemake_config(d): | ||
2 | plat = d.getVar('XVISOR_PLAT') | ||
3 | |||
4 | if plat is None: | ||
5 | return "" | ||
6 | |||
7 | if 'riscv/virt32' in plat: | ||
8 | return "generic-32b-defconfig" | ||
9 | if 'riscv/virt64' in plat: | ||
10 | return "generic-64b-defconfig" | ||
11 | |||
12 | return "" | ||
13 | |||
14 | def map_xvisor_arch(a, d): | ||
15 | import re | ||
16 | |||
17 | if re.match('(i.86|x86.64)$', a): return 'x86' | ||
18 | elif re.match('armeb$', a): return 'arm' | ||
19 | elif re.match('aarch64$', a): return 'arm' | ||
20 | elif re.match('aarch64_be$', a): return 'arm' | ||
21 | elif re.match('aarch64_ilp32$', a): return 'arm' | ||
22 | elif re.match('aarch64_be_ilp32$', a): return 'arm' | ||
23 | elif re.match('riscv(32|64|)(eb|)$', a): return 'riscv' | ||
24 | else: | ||
25 | bb.error("cannot map '%s' to a Xvisor architecture" % a) | ||
diff --git a/recipes-extended/xvisor/xvisor_0.3.0.bb b/recipes-extended/xvisor/xvisor_0.3.0.bb new file mode 100644 index 00000000..66ad6187 --- /dev/null +++ b/recipes-extended/xvisor/xvisor_0.3.0.bb | |||
@@ -0,0 +1,44 @@ | |||
1 | SUMMARY = "Xvisor is an open-source type-1 hypervisor, which aims at providing a monolithic, light-weight, portable, and flexible virtualization solution." | ||
2 | DESCRIPTION = "Xvisor primarily supports Full virtualization hence, supports a wide range of unmodified guest operating systems. Paravirtualization is optional for Xvisor and will be supported in an architecture independent manner (such as VirtIO PCI/MMIO devices) to ensure no-change in guest OS for using paravirtualization." | ||
3 | LICENSE = "GPLv2" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
5 | DEPENDS += "dtc-native dosfstools-native mtools-native" | ||
6 | |||
7 | require xvisor-configs.inc | ||
8 | |||
9 | inherit autotools-brokensep | ||
10 | |||
11 | SRCREV = "58592ef18c71526a0045935d1e8eed5e8553b7d6" | ||
12 | SRC_URI = "git://github.com/xvisor/xvisor.git \ | ||
13 | file://0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch \ | ||
14 | " | ||
15 | |||
16 | S = "${WORKDIR}/git" | ||
17 | |||
18 | EXTRA_OEMAKE += "ARCH=\"${@map_xvisor_arch(d.getVar('TARGET_ARCH'), d)}\" I=${D}" | ||
19 | |||
20 | CONFIG = "${@get_oemake_config(d)}" | ||
21 | |||
22 | do_configure() { | ||
23 | oe_runmake ${CONFIG} | ||
24 | } | ||
25 | |||
26 | do_install_append() { | ||
27 | install -d ${D} | ||
28 | install -m 755 ${B}/build/vmm.* ${D}/ | ||
29 | |||
30 | # We don't need this | ||
31 | rm ${D}/system.map | ||
32 | } | ||
33 | |||
34 | do_deploy () { | ||
35 | install -d ${DEPLOY_DIR_IMAGE} | ||
36 | install -m 755 ${D}/vmm.* ${DEPLOY_DIR_IMAGE}/ | ||
37 | } | ||
38 | |||
39 | addtask deploy after do_install | ||
40 | |||
41 | FILES_${PN} += "/vmm.*" | ||
42 | |||
43 | COMPATIBLE_HOST = "(riscv64|riscv32).*" | ||
44 | INHIBIT_PACKAGE_STRIP = "1" | ||