diff options
author | Ting Liu <ting.liu@nxp.com> | 2020-04-18 23:54:13 +0800 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2020-04-20 16:17:28 -0300 |
commit | 8e115ab460032de8a3495588b642ca82892f93b1 (patch) | |
tree | 425267a6e5a2e00c77b1812866f2a53e4fbcb52f | |
parent | 9932e8145f250b3b1f86eb0c6af2cc48bf98ae45 (diff) | |
download | meta-freescale-8e115ab460032de8a3495588b642ca82892f93b1.tar.gz |
qemu-qoriq: upgrade to 4.1
Signed-off-by: Ting Liu <ting.liu@nxp.com>
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 @@ | |||
1 | From 0f1f2d4596aee037d3ccbcf10592466daa54107f Mon Sep 17 00:00:00 2001 | ||
2 | From: Laurent Vivier <laurent@vivier.eu> | ||
3 | Date: Tue, 12 Nov 2019 15:25:56 +0100 | ||
4 | Subject: [PATCH] linux-user: remove host stime() syscall | ||
5 | |||
6 | stime() has been withdrawn from glibc | ||
7 | (12cbde1dae6f "Use clock_settime to implement stime; withdraw stime.") | ||
8 | |||
9 | Implement the target stime() syscall using host | ||
10 | clock_settime(CLOCK_REALTIME, ...) as it is done internally in glibc. | ||
11 | |||
12 | Tested 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 | |||
34 | Upstream-Status: Backport | ||
35 | |||
36 | Buglink: https://bugs.launchpad.net/qemu/+bug/1852115 | ||
37 | Reported-by: Cole Robinson <crobinso@redhat.com> | ||
38 | Signed-off-by: Laurent Vivier <laurent@vivier.eu> | ||
39 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
40 | Message-Id: <20191112142556.6335-1-laurent@vivier.eu> | ||
41 | --- | ||
42 | linux-user/syscall.c | 8 +++++--- | ||
43 | 1 file changed, 5 insertions(+), 3 deletions(-) | ||
44 | |||
45 | diff --git a/linux-user/syscall.c b/linux-user/syscall.c | ||
46 | index 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 | -- | ||
66 | 2.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 @@ | |||
1 | From 8ee6281516bd9210e75e91d705da8916bab3bf51 Mon Sep 17 00:00:00 2001 | ||
2 | From: Juro Bystricky <juro.bystricky@intel.com> | ||
3 | Date: Thu, 31 Aug 2017 11:06:56 -0700 | ||
4 | Subject: [PATCH] Add subpackage -ptest which runs all unit test cases for | ||
5 | qemu. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
10 | |||
11 | Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> | ||
12 | |||
13 | --- | ||
14 | tests/Makefile.include | 8 ++++++++ | ||
15 | 1 file changed, 8 insertions(+) | ||
16 | |||
17 | diff --git a/tests/Makefile.include b/tests/Makefile.include | ||
18 | index 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 @@ | |||
1 | From d60ecdd94f4054aa0ec615824d5efdb4cebc7db9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ting Liu <ting.liu@nxp.com> | ||
3 | Date: Thu, 19 Apr 2018 11:47:16 +0800 | ||
4 | Subject: [PATCH] memfd | ||
5 | |||
6 | --- | ||
7 | configure | 2 +- | ||
8 | util/memfd.c | 4 +--- | ||
9 | 2 files changed, 2 insertions(+), 4 deletions(-) | ||
10 | |||
11 | diff --git a/configure b/configure | ||
12 | index 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 | { | ||
24 | diff --git a/util/memfd.c b/util/memfd.c | ||
25 | index 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 | -- | ||
40 | 2.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")") | |||
7 | export SRC_PATH=$ptestdir | 7 | export SRC_PATH=$ptestdir |
8 | 8 | ||
9 | cd $ptestdir/tests | 9 | cd $ptestdir/tests |
10 | make -f Makefile.include -k runtest-TESTS | sed '/: OK/ s/^/PASS: /g' | 10 | make -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 @@ | |||
1 | BBCLASSEXTEND = "" | ||
2 | |||
3 | require recipes-devtools/qemu/qemu.inc | ||
4 | |||
5 | COMPATIBLE_MACHINE = "(qoriq)" | ||
6 | |||
7 | DEPENDS = "glib-2.0 zlib pixman bison-native" | ||
8 | |||
9 | LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ | ||
10 | file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f" | ||
11 | |||
12 | SRC_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 | |||
19 | SRCREV = "521a0dcf59f1ca11e7d9e2f4e1ef3d2dfaebc0e4" | ||
20 | |||
21 | S = "${WORKDIR}/git" | ||
22 | |||
23 | python() { | ||
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 | |||
33 | RDEPENDS_${PN}_class-target += "bash" | ||
34 | |||
35 | EXTRA_OECONF_append_class-target = " --target-list=${@get_qemu_target_list(d)}" | ||
36 | EXTRA_OECONF_append_class-target_mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}" | ||
37 | EXTRA_OECONF_append_class-nativesdk = " --target-list=${@get_qemu_target_list(d)}" | ||
38 | |||
39 | do_install_append_class-nativesdk() { | ||
40 | ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)} | ||
41 | } | ||
42 | |||
43 | PACKAGECONFIG ??= " \ | ||
44 | fdt sdl kvm \ | ||
45 | ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \ | ||
46 | " | ||
47 | PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm" | ||
48 | |||
49 | PACKAGECONFIG[xkbcommon] = ",," | ||
50 | PACKAGECONFIG[libudev] = ",," | ||
51 | |||
52 | DISABLE_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 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
2 | |||
3 | require recipes-devtools/qemu/qemu.inc | ||
4 | |||
5 | inherit ptest | ||
6 | |||
7 | RDEPENDS_${PN}-ptest = "bash make" | ||
8 | DEPENDS = "glib-2.0 zlib pixman dtc" | ||
9 | |||
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ | ||
11 | file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913" | ||
12 | |||
13 | SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/qemu;nobranch=1 \ | ||
14 | file://powerpc_rom.bin \ | ||
15 | file://run-ptest \ | ||
16 | " | ||
17 | |||
18 | SRCREV = "ca6417b6c3fa7a965d021c98d079a1895c973dbb" | ||
19 | |||
20 | S = "${WORKDIR}/git" | ||
21 | |||
22 | COMPATIBLE_MACHINE = "(qoriq|imx)" | ||
23 | |||
24 | PROVIDES = "qemu" | ||
25 | |||
26 | python() { | ||
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 | |||
35 | EXTRA_OECONF_append = " --python=python2.7" | ||
36 | |||
37 | PPC_OECONF = '--enable-fdt --enable-kvm --with-system-pixman --disable-werror' | ||
38 | EXTRA_OECONF_qoriq-arm64 = "--prefix=${prefix} --target-list=aarch64-softmmu --enable-fdt --enable-kvm --with-system-pixman --disable-werror" | ||
39 | EXTRA_OECONF_qoriq-arm = "--prefix=${prefix} --target-list=arm-softmmu --enable-fdt --enable-kvm --with-system-pixman --disable-werror" | ||
40 | EXTRA_OECONF_e5500-64b = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}" | ||
41 | EXTRA_OECONF_e6500-64b = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}" | ||
42 | EXTRA_OECONF_e6500 = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}" | ||
43 | EXTRA_OECONF_e5500 = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}" | ||
44 | EXTRA_OECONF_e500v2 = "--prefix=${prefix} --target-list=ppc-softmmu ${PPC_OECONF}" | ||
45 | EXTRA_OECONF_e500mc = "--prefix=${prefix} --target-list=ppc-softmmu ${PPC_OECONF}" | ||
46 | |||
47 | DISABLE_STATIC = "" | ||
48 | |||
49 | do_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 | |||
55 | do_compile_ptest() { | ||
56 | make buildtest-TESTS | ||
57 | } | ||
58 | |||
59 | do_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 | |||
69 | INSANE_SKIP_${PN} += "already-stripped" | ||
70 | FILES_${PN} += "/usr/share/qemu/* /usr/var/*" | ||
71 | |||
72 | # FIXME: Avoid WARNING due missing patch for native/nativesdk | ||
73 | BBCLASSEXTEND = "" | ||