diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2019-02-27 18:47:31 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-28 13:21:54 +0000 |
commit | 48522906a261f9a552f13b146aa7f3691be37002 (patch) | |
tree | a40226291f277540547ebd1c637de5d203cd2378 /meta/recipes-devtools/qemu/qemu.inc | |
parent | 80d29f1cb1e077cc457a6917fa57561a88921fca (diff) | |
download | poky-48522906a261f9a552f13b146aa7f3691be37002.tar.gz |
qemu: split the native version into usermode and system parts
The rationale is to streamline the overall build.
The system parts are only needed to run target images, and so can be
built towards the end of the build process. At the same time, the
system parts may need gtk+-native and mesa-native which add significantly
to the build time.
On the other hand, the usermode parts have almost no dependencies
and can be built quickly. They are needed at recipes build time to
run target binaries, and so are required quite early in the typical
build process.
(From OE-Core rev: 4a558a5f2db68538e0edad798ddf48eb9510a7d6)
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu.inc')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 97 |
1 files changed, 60 insertions, 37 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 7fd580c8ae..ebee2974d2 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -1,12 +1,59 @@ | |||
1 | SUMMARY = "Fast open source processor emulator" | 1 | SUMMARY = "Fast open source processor emulator" |
2 | HOMEPAGE = "http://qemu.org" | 2 | HOMEPAGE = "http://qemu.org" |
3 | LICENSE = "GPLv2 & LGPLv2.1" | 3 | LICENSE = "GPLv2 & LGPLv2.1" |
4 | DEPENDS = "glib-2.0 zlib pixman" | 4 | |
5 | RDEPENDS_${PN}_class-target += "bash" | 5 | RDEPENDS_${PN}-ptest = "bash make" |
6 | |||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ | ||
8 | file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913" | ||
9 | |||
10 | SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | ||
11 | file://powerpc_rom.bin \ | ||
12 | file://0001-sdl.c-allow-user-to-disable-pointer-grabs.patch \ | ||
13 | file://0002-qemu-Add-missing-wacom-HID-descriptor.patch \ | ||
14 | file://0003-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch \ | ||
15 | file://run-ptest \ | ||
16 | file://0004-qemu-Add-addition-environment-space-to-boot-loader-q.patch \ | ||
17 | file://0005-qemu-disable-Valgrind.patch \ | ||
18 | file://0006-qemu-Limit-paths-searched-during-user-mode-emulation.patch \ | ||
19 | file://0007-qemu-native-set-ld.bfd-fix-cflags-and-set-some-envir.patch \ | ||
20 | file://0008-chardev-connect-socket-to-a-spawned-command.patch \ | ||
21 | file://0009-apic-fixup-fallthrough-to-PIC.patch \ | ||
22 | file://0010-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \ | ||
23 | file://0011-Revert-linux-user-fix-mmap-munmap-mprotect-mremap-sh.patch \ | ||
24 | file://0001-Add-a-missing-X11-include.patch \ | ||
25 | file://0001-egl-headless-add-egl_create_context.patch \ | ||
26 | " | ||
27 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | ||
28 | |||
29 | SRC_URI[md5sum] = "fb687ce0b02d3bf4327e36d3b99427a8" | ||
30 | SRC_URI[sha256sum] = "6a0508df079a0a33c2487ca936a56c12122f105b8a96a44374704bef6c69abfc" | ||
31 | |||
32 | COMPATIBLE_HOST_mipsarchn32 = "null" | ||
33 | COMPATIBLE_HOST_mipsarchn64 = "null" | ||
34 | |||
35 | do_install_append() { | ||
36 | # Prevent QA warnings about installed ${localstatedir}/run | ||
37 | if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi | ||
38 | } | ||
39 | |||
40 | do_compile_ptest() { | ||
41 | make buildtest-TESTS | ||
42 | } | ||
43 | |||
44 | do_install_ptest() { | ||
45 | cp -rL ${B}/tests ${D}${PTEST_PATH} | ||
46 | find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {} | ||
47 | |||
48 | cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests | ||
49 | # Don't check the file genreated by configure | ||
50 | sed -i -e '/wildcard config-host.mak/d' \ | ||
51 | -e '$ {/endif/d}' ${D}${PTEST_PATH}/tests/Makefile.include | ||
52 | } | ||
53 | |||
6 | 54 | ||
7 | require qemu-targets.inc | 55 | require qemu-targets.inc |
8 | inherit pkgconfig bluetooth | 56 | inherit pkgconfig bluetooth ptest |
9 | BBCLASSEXTEND = "native nativesdk" | ||
10 | 57 | ||
11 | # QEMU_TARGETS is overridable variable | 58 | # QEMU_TARGETS is overridable variable |
12 | QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc riscv32 riscv64 sh4 x86_64" | 59 | QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc riscv32 riscv64 sh4 x86_64" |
@@ -25,15 +72,9 @@ EXTRA_OECONF = " \ | |||
25 | --with-confsuffix=/${BPN} \ | 72 | --with-confsuffix=/${BPN} \ |
26 | --disable-strip \ | 73 | --disable-strip \ |
27 | --disable-werror \ | 74 | --disable-werror \ |
28 | --target-list=${@get_qemu_target_list(d)} \ | ||
29 | --extra-cflags='${CFLAGS}' \ | 75 | --extra-cflags='${CFLAGS}' \ |
30 | ${PACKAGECONFIG_CONFARGS} \ | 76 | ${PACKAGECONFIG_CONFARGS} \ |
31 | " | 77 | " |
32 | EXTRA_OECONF_append_class-native = " --python=python2.7" | ||
33 | |||
34 | EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'" | ||
35 | |||
36 | LDFLAGS_append_class-native = " -fuse-ld=bfd" | ||
37 | 78 | ||
38 | export LIBTOOL="${HOST_SYS}-libtool" | 79 | export LIBTOOL="${HOST_SYS}-libtool" |
39 | 80 | ||
@@ -56,25 +97,6 @@ do_install () { | |||
56 | oe_runmake 'DESTDIR=${D}' install | 97 | oe_runmake 'DESTDIR=${D}' install |
57 | } | 98 | } |
58 | 99 | ||
59 | make_qemu_wrapper() { | ||
60 | gdk_pixbuf_module_file=`pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0` | ||
61 | |||
62 | for tool in `ls ${D}${bindir}/qemu-system-*`; do | ||
63 | create_wrapper $tool \ | ||
64 | GDK_PIXBUF_MODULE_FILE=$gdk_pixbuf_module_file \ | ||
65 | FONTCONFIG_PATH=/etc/fonts \ | ||
66 | GTK_THEME=Adwaita | ||
67 | done | ||
68 | } | ||
69 | |||
70 | do_install_append_class-native() { | ||
71 | ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)} | ||
72 | } | ||
73 | |||
74 | do_install_append_class-nativesdk() { | ||
75 | ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)} | ||
76 | } | ||
77 | |||
78 | # The following fragment will create a wrapper for qemu-mips user emulation | 100 | # The following fragment will create a wrapper for qemu-mips user emulation |
79 | # binary in order to work around a segmentation fault issue. Basically, by | 101 | # binary in order to work around a segmentation fault issue. Basically, by |
80 | # default, the reserved virtual address space for 32-on-64 bit is set to 4GB. | 102 | # default, the reserved virtual address space for 32-on-64 bit is set to 4GB. |
@@ -89,15 +111,16 @@ do_install_append() { | |||
89 | } | 111 | } |
90 | # END of qemu-mips workaround | 112 | # END of qemu-mips workaround |
91 | 113 | ||
92 | PACKAGECONFIG ??= " \ | 114 | make_qemu_wrapper() { |
93 | fdt sdl kvm \ | 115 | gdk_pixbuf_module_file=`pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0` |
94 | ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \ | ||
95 | " | ||
96 | PACKAGECONFIG_class-native ??= "fdt alsa kvm" | ||
97 | PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm" | ||
98 | 116 | ||
99 | # Handle distros such as CentOS 5 32-bit that do not have kvm support | 117 | for tool in `ls ${D}${bindir}/qemu-system-*`; do |
100 | PACKAGECONFIG_class-native_remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}" | 118 | create_wrapper $tool \ |
119 | GDK_PIXBUF_MODULE_FILE=$gdk_pixbuf_module_file \ | ||
120 | FONTCONFIG_PATH=/etc/fonts \ | ||
121 | GTK_THEME=Adwaita | ||
122 | done | ||
123 | } | ||
101 | 124 | ||
102 | # Disable kvm on targets that do not support it | 125 | # Disable kvm on targets that do not support it |
103 | PACKAGECONFIG_remove_darwin = "kvm" | 126 | PACKAGECONFIG_remove_darwin = "kvm" |