summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing Liu <ting.liu@nxp.com>2020-04-18 23:54:13 +0800
committerOtavio Salvador <otavio@ossystems.com.br>2020-04-20 16:17:28 -0300
commit8e115ab460032de8a3495588b642ca82892f93b1 (patch)
tree425267a6e5a2e00c77b1812866f2a53e4fbcb52f
parent9932e8145f250b3b1f86eb0c6af2cc48bf98ae45 (diff)
downloadmeta-freescale-8e115ab460032de8a3495588b642ca82892f93b1.tar.gz
qemu-qoriq: upgrade to 4.1
Signed-off-by: Ting Liu <ting.liu@nxp.com>
-rw-r--r--recipes-devtools/qemu/qemu-qoriq/0001-linux-user-remove-host-stime-syscall.patch67
-rw-r--r--recipes-devtools/qemu/qemu-qoriq/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch33
-rw-r--r--recipes-devtools/qemu/qemu-qoriq/memfd.patch41
-rw-r--r--recipes-devtools/qemu/qemu-qoriq/run-ptest2
-rw-r--r--recipes-devtools/qemu/qemu-qoriq_4.1.0.bb53
-rw-r--r--recipes-devtools/qemu/qemu-qoriq_git.bb73
6 files changed, 154 insertions, 115 deletions
diff --git a/recipes-devtools/qemu/qemu-qoriq/0001-linux-user-remove-host-stime-syscall.patch b/recipes-devtools/qemu/qemu-qoriq/0001-linux-user-remove-host-stime-syscall.patch
new file mode 100644
index 00000000..2d3bd7e0
--- /dev/null
+++ b/recipes-devtools/qemu/qemu-qoriq/0001-linux-user-remove-host-stime-syscall.patch
@@ -0,0 +1,67 @@
1From 0f1f2d4596aee037d3ccbcf10592466daa54107f Mon Sep 17 00:00:00 2001
2From: Laurent Vivier <laurent@vivier.eu>
3Date: Tue, 12 Nov 2019 15:25:56 +0100
4Subject: [PATCH] linux-user: remove host stime() syscall
5
6stime() has been withdrawn from glibc
7(12cbde1dae6f "Use clock_settime to implement stime; withdraw stime.")
8
9Implement the target stime() syscall using host
10clock_settime(CLOCK_REALTIME, ...) as it is done internally in glibc.
11
12Tested qemu-ppc/x86_64 with:
13
14 #include <time.h>
15 #include <stdio.h>
16
17 int main(void)
18 {
19 time_t t;
20 int ret;
21
22 /* date -u -d"2019-11-12T15:11:00" "+%s" */
23 t = 1573571460;
24 ret = stime(&t);
25 printf("ret %d\n", ret);
26 return 0;
27 }
28
29 # date; ./stime; date
30 Tue Nov 12 14:18:32 UTC 2019
31 ret 0
32 Tue Nov 12 15:11:00 UTC 2019
33
34Upstream-Status: Backport
35
36Buglink: https://bugs.launchpad.net/qemu/+bug/1852115
37Reported-by: Cole Robinson <crobinso@redhat.com>
38Signed-off-by: Laurent Vivier <laurent@vivier.eu>
39Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
40Message-Id: <20191112142556.6335-1-laurent@vivier.eu>
41---
42 linux-user/syscall.c | 8 +++++---
43 1 file changed, 5 insertions(+), 3 deletions(-)
44
45diff --git a/linux-user/syscall.c b/linux-user/syscall.c
46index 4e97bcf1e5..ce399a55f0 100644
47--- a/linux-user/syscall.c
48+++ b/linux-user/syscall.c
49@@ -7764,10 +7764,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
50 #ifdef TARGET_NR_stime /* not on alpha */
51 case TARGET_NR_stime:
52 {
53- time_t host_time;
54- if (get_user_sal(host_time, arg1))
55+ struct timespec ts;
56+ ts.tv_nsec = 0;
57+ if (get_user_sal(ts.tv_sec, arg1)) {
58 return -TARGET_EFAULT;
59- return get_errno(stime(&host_time));
60+ }
61+ return get_errno(clock_settime(CLOCK_REALTIME, &ts));
62 }
63 #endif
64 #ifdef TARGET_NR_alarm /* not on alpha */
65--
662.24.0
67
diff --git a/recipes-devtools/qemu/qemu-qoriq/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch b/recipes-devtools/qemu/qemu-qoriq/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch
new file mode 100644
index 00000000..7f7da510
--- /dev/null
+++ b/recipes-devtools/qemu/qemu-qoriq/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch
@@ -0,0 +1,33 @@
1From 8ee6281516bd9210e75e91d705da8916bab3bf51 Mon Sep 17 00:00:00 2001
2From: Juro Bystricky <juro.bystricky@intel.com>
3Date: Thu, 31 Aug 2017 11:06:56 -0700
4Subject: [PATCH] Add subpackage -ptest which runs all unit test cases for
5 qemu.
6
7Upstream-Status: Pending
8
9Signed-off-by: Kai Kang <kai.kang@windriver.com>
10
11Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
12
13---
14 tests/Makefile.include | 8 ++++++++
15 1 file changed, 8 insertions(+)
16
17diff --git a/tests/Makefile.include b/tests/Makefile.include
18index 8566f5f1..52d0320b 100644
19--- a/tests/Makefile.include
20+++ b/tests/Makefile.include
21@@ -1210,4 +1210,12 @@ all: $(QEMU_IOTESTS_HELPERS-y)
22 -include $(wildcard tests/*.d)
23 -include $(wildcard tests/libqos/*.d)
24
25+buildtest-TESTS: $(check-unit-y)
26+
27+runtest-TESTS:
28+ for f in $(check-unit-y); do \
29+ nf=$$(echo $$f | sed 's/tests\//\.\//g'); \
30+ $$nf; \
31+ done
32+
33 endif
diff --git a/recipes-devtools/qemu/qemu-qoriq/memfd.patch b/recipes-devtools/qemu/qemu-qoriq/memfd.patch
deleted file mode 100644
index d9e7a455..00000000
--- a/recipes-devtools/qemu/qemu-qoriq/memfd.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1From d60ecdd94f4054aa0ec615824d5efdb4cebc7db9 Mon Sep 17 00:00:00 2001
2From: Ting Liu <ting.liu@nxp.com>
3Date: Thu, 19 Apr 2018 11:47:16 +0800
4Subject: [PATCH] memfd
5
6---
7 configure | 2 +-
8 util/memfd.c | 4 +---
9 2 files changed, 2 insertions(+), 4 deletions(-)
10
11diff --git a/configure b/configure
12index be4d326..cb5197c 100755
13--- a/configure
14+++ b/configure
15@@ -3735,7 +3735,7 @@ fi
16 # check if memfd is supported
17 memfd=no
18 cat > $TMPC << EOF
19-#include <sys/memfd.h>
20+#include <sys/mman.h>
21
22 int main(void)
23 {
24diff --git a/util/memfd.c b/util/memfd.c
25index 4571d1a..412e94a 100644
26--- a/util/memfd.c
27+++ b/util/memfd.c
28@@ -31,9 +31,7 @@
29
30 #include "qemu/memfd.h"
31
32-#ifdef CONFIG_MEMFD
33-#include <sys/memfd.h>
34-#elif defined CONFIG_LINUX
35+#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
36 #include <sys/syscall.h>
37 #include <asm/unistd.h>
38
39--
402.7.4
41
diff --git a/recipes-devtools/qemu/qemu-qoriq/run-ptest b/recipes-devtools/qemu/qemu-qoriq/run-ptest
index 2206b319..b25a792d 100644
--- a/recipes-devtools/qemu/qemu-qoriq/run-ptest
+++ b/recipes-devtools/qemu/qemu-qoriq/run-ptest
@@ -7,4 +7,4 @@ ptestdir=$(dirname "$(readlink -f "$0")")
7export SRC_PATH=$ptestdir 7export SRC_PATH=$ptestdir
8 8
9cd $ptestdir/tests 9cd $ptestdir/tests
10make -f Makefile.include -k runtest-TESTS | sed '/: OK/ s/^/PASS: /g' 10make -f Makefile.include -k runtest-TESTS | sed '/^ok /s/ok /PASS: /g'
diff --git a/recipes-devtools/qemu/qemu-qoriq_4.1.0.bb b/recipes-devtools/qemu/qemu-qoriq_4.1.0.bb
new file mode 100644
index 00000000..1880c8ae
--- /dev/null
+++ b/recipes-devtools/qemu/qemu-qoriq_4.1.0.bb
@@ -0,0 +1,53 @@
1BBCLASSEXTEND = ""
2
3require recipes-devtools/qemu/qemu.inc
4
5COMPATIBLE_MACHINE = "(qoriq)"
6
7DEPENDS = "glib-2.0 zlib pixman bison-native"
8
9LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
10 file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
11
12SRC_URI = "gitsm://source.codeaurora.org/external/qoriq/qoriq-components/qemu;nobranch=1 \
13 file://powerpc_rom.bin \
14 file://run-ptest \
15 file://0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch \
16 file://0001-linux-user-remove-host-stime-syscall.patch \
17 "
18
19SRCREV = "521a0dcf59f1ca11e7d9e2f4e1ef3d2dfaebc0e4"
20
21S = "${WORKDIR}/git"
22
23python() {
24 d.appendVar('PROVIDES', ' ' + d.getVar('BPN').replace('-qoriq', ''))
25 pkgs = d.getVar('PACKAGES').split()
26 for p in pkgs:
27 if '-qoriq' in p:
28 d.appendVar('RPROVIDES_' + p, ' ' + p.replace('-qoriq', ''))
29 d.appendVar('RCONFLICTS_' + p, ' ' + p.replace('-qoriq', ''))
30 d.appendVar('RREPLACES_' + p, ' ' + p.replace('-qoriq', ''))
31}
32
33RDEPENDS_${PN}_class-target += "bash"
34
35EXTRA_OECONF_append_class-target = " --target-list=${@get_qemu_target_list(d)}"
36EXTRA_OECONF_append_class-target_mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}"
37EXTRA_OECONF_append_class-nativesdk = " --target-list=${@get_qemu_target_list(d)}"
38
39do_install_append_class-nativesdk() {
40 ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)}
41}
42
43PACKAGECONFIG ??= " \
44 fdt sdl kvm \
45 ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \
46"
47PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm"
48
49PACKAGECONFIG[xkbcommon] = ",,"
50PACKAGECONFIG[libudev] = ",,"
51
52DISABLE_STATIC = ""
53
diff --git a/recipes-devtools/qemu/qemu-qoriq_git.bb b/recipes-devtools/qemu/qemu-qoriq_git.bb
deleted file mode 100644
index 30d255ee..00000000
--- a/recipes-devtools/qemu/qemu-qoriq_git.bb
+++ /dev/null
@@ -1,73 +0,0 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
3require recipes-devtools/qemu/qemu.inc
4
5inherit ptest
6
7RDEPENDS_${PN}-ptest = "bash make"
8DEPENDS = "glib-2.0 zlib pixman dtc"
9
10LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
11 file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
12
13SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/qemu;nobranch=1 \
14 file://powerpc_rom.bin \
15 file://run-ptest \
16 "
17
18SRCREV = "ca6417b6c3fa7a965d021c98d079a1895c973dbb"
19
20S = "${WORKDIR}/git"
21
22COMPATIBLE_MACHINE = "(qoriq|imx)"
23
24PROVIDES = "qemu"
25
26python() {
27 pkgs = d.getVar('PACKAGES').split()
28 for p in pkgs:
29 if 'qemu-qoriq' in p:
30 d.appendVar("RPROVIDES_%s" % p, p.replace('qemu-qoriq', 'qemu'))
31 d.appendVar("RCONFLICTS_%s" % p, p.replace('qemu-qoriq', 'qemu'))
32 d.appendVar("RREPLACES_%s" % p, p.replace('qemu-qoriq', 'qemu'))
33}
34
35EXTRA_OECONF_append = " --python=python2.7"
36
37PPC_OECONF = '--enable-fdt --enable-kvm --with-system-pixman --disable-werror'
38EXTRA_OECONF_qoriq-arm64 = "--prefix=${prefix} --target-list=aarch64-softmmu --enable-fdt --enable-kvm --with-system-pixman --disable-werror"
39EXTRA_OECONF_qoriq-arm = "--prefix=${prefix} --target-list=arm-softmmu --enable-fdt --enable-kvm --with-system-pixman --disable-werror"
40EXTRA_OECONF_e5500-64b = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}"
41EXTRA_OECONF_e6500-64b = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}"
42EXTRA_OECONF_e6500 = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}"
43EXTRA_OECONF_e5500 = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}"
44EXTRA_OECONF_e500v2 = "--prefix=${prefix} --target-list=ppc-softmmu ${PPC_OECONF}"
45EXTRA_OECONF_e500mc = "--prefix=${prefix} --target-list=ppc-softmmu ${PPC_OECONF}"
46
47DISABLE_STATIC = ""
48
49do_install_append() {
50 # Prevent QA warnings about installed ${localstatedir}/run
51 if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
52 install -Dm 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
53}
54
55do_compile_ptest() {
56 make buildtest-TESTS
57}
58
59do_install_ptest() {
60 cp -rL ${B}/tests ${D}${PTEST_PATH}
61 find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
62
63 cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests
64 # Don't check the file genreated by configure
65 sed -i -e '/wildcard config-host.mak/d' \
66 -e '$ {/endif/d}' ${D}${PTEST_PATH}/tests/Makefile.include
67}
68
69INSANE_SKIP_${PN} += "already-stripped"
70FILES_${PN} += "/usr/share/qemu/* /usr/var/*"
71
72# FIXME: Avoid WARNING due missing patch for native/nativesdk
73BBCLASSEXTEND = ""