Date   

[PATCH 3/3] grub-efi: Add xen_boot support when 'xen' is in DISTRO_FEATURES for aarch64

Kamil Dziezyk
 

Signed-off-by: Kamil Dziezyk <kamil.dziezyk@...>
---
recipes-bsp/grub/grub-efi_%.bbappend | 1 +
recipes-bsp/grub/grub-efi_xen.inc | 1 +
2 files changed, 2 insertions(+)
create mode 100644 recipes-bsp/grub/grub-efi_%.bbappend
create mode 100644 recipes-bsp/grub/grub-efi_xen.inc

diff --git a/recipes-bsp/grub/grub-efi_%.bbappend b/recipes-bsp/grub/grub-efi_%.bbappend
new file mode 100644
index 0000000..df2b688
--- /dev/null
+++ b/recipes-bsp/grub/grub-efi_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${BPN}_xen.inc', '', d)}
diff --git a/recipes-bsp/grub/grub-efi_xen.inc b/recipes-bsp/grub/grub-efi_xen.inc
new file mode 100644
index 0000000..5aa0958
--- /dev/null
+++ b/recipes-bsp/grub/grub-efi_xen.inc
@@ -0,0 +1 @@
+GRUB_BUILDIN:append:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' xen_boot', '', d)}"
--
2.17.1


[PATCH 1/3] xen-tools: Load xen related kernel modules during system boot

Kamil Dziezyk
 

This patch changes the location of xen.conf file, that contains list of kernel
modules to be loaded during system boot, to "${nonarch_libdir}". This is done
by removing '--with-systemd-modules-load=' flag from EXTRA_OECONF variable.

Previous path based on "${systemd_unitdir}" was not considered by default by
systemd-modules-load.service.

Signed-off-by: Kamil Dziezyk <kamil.dziezyk@...>
---
recipes-extended/xen/xen-tools.inc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
index d831941..6b99040 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -653,10 +653,10 @@ FILES:${PN}-xm = "\
"

FILES:${PN}-xencommons += "\
+ ${nonarch_libdir}/modules-load.d/xen.conf \
${sysconfdir}/default/xencommons \
${sysconfdir}/init.d/xencommons \
${sysconfdir}/xen/scripts/launch-xenstore \
- ${systemd_unitdir}/modules-load.d/xen.conf \
${systemd_unitdir}/system/proc-xen.mount \
${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service \
${systemd_unitdir}/system/xenconsoled.service \
@@ -744,7 +744,6 @@ SYSTEMD_SERVICE:${PN}-xendomains = "xendomains.service"

EXTRA_OECONF += " \
--with-systemd=${systemd_unitdir}/system \
- --with-systemd-modules-load=${systemd_unitdir}/modules-load.d \
--with-initddir=${INIT_D_DIR} \
--with-sysconfig-leaf-dir=default \
--with-system-qemu=${bindir}/qemu-system-i386 \
--
2.17.1


Re: [dunfell][gatesgarth][hardknott][master][PATCH] uxen-guest-tools: inherit dos2unix to fix do_patch failure

Christopher Clark
 

On Tue, Nov 30, 2021 at 8:52 AM Martin Jansa <martin.jansa@...> wrote:

Hi Martin, Bruce

Apologies for taking a long time to reply to the work on the uxen tools and thanks to both of you for your patches.


Christopher can you please try to upstream these changes for newer kernels? Me and Bruce both failed to find up2date upstream repo, but you mentioned before that you have reported the issue in some upstream bugtracker (where you can possibly propose these changes).

Ack, and I agree, I would like to get this fixed upstream to retire the patches. The issue tracker is https://github.com/uxen-virt/uxen/issues and I'll add a reference to that to the recipe in my next update to it.
 

I never used uxen-guest-tools, I was fixing it just to resolve build failures in world builds, so I haven't tested it in runtime at all.

Ack - thanks for addressing the build issue. I've now studied the patches, the uxen tools driver code and code in Linux, and believe that some additional changes may be necessary for the newer kernels - I will look into that (I will need a bit of time, with holidays, end of year etc. - hope that's ok).

Christopher

 

Regards,

On Tue, Nov 30, 2021 at 4:36 PM Martin Jansa via lists.yoctoproject.org <Martin.Jansa=gmail.com@...> wrote:

On Thu, Jul 29, 2021 at 7:53 PM Christopher Clark <christopher.w.clark@...> wrote:
On Fri, Jul 23, 2021 at 9:55 AM Bruce Ashfield <bruce.ashfield@...> wrote:
>
> On Fri, Jul 23, 2021 at 9:29 AM Martin Jansa <Martin.Jansa@...> wrote:
> >
> > it builds ok with 5.4 in dunfell now, only gatesgarth with 5.8 and newer with 5.10 kernel are broken
> >
>
> I've applied your patch, and have pushed it to the repo.
>
> I'm also seeing the build failure now.
>
> I tried to bump the version of the package, but it still has the same
> kernel build issue. (my efforts are here:
> https://git.yoctoproject.org/cgit/cgit.cgi/meta-virtualization/commit/?h=master-test&id=3ae2e9b3036890968cb9b152d128db9b47f01c89)
>
> Christoper: did you want to take a look at the uprev / fix of the build ?

A quick update on this: I did take a look and repro'd the build
failure with the current Linux 5.10 kernel.
I've filed a ticket on the upstream project issue tracker with some
details and am waiting on a response.

Christopher

>
> Bruce
>
>
> > On Fri, Jul 23, 2021 at 2:54 PM Martin Jansa via lists.yoctoproject.org <Martin.Jansa=gmail.com@...> wrote:
> >>
> >> Now with do_patch fixed it fails a bit later in do_compile with:
> >>
> >> | make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
> >> | make[1]: Entering directory '/OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source'
> >> | make[2]: Entering directory '/OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-build-artifacts'
> >> |   CC [M]  /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.o
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c: In function 'uxen_hypercall_init':
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:127:24: error: too many arguments to function '__vmalloc'
> >> |   127 |         uxen_hcbase =  __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);
> >> |       |                        ^~~~~~~~~
> >> | In file included from /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:9:
> >> | /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/vmalloc.h:131:14: note: declared here
> >> |   131 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);
> >> |       |              ^~~~~~~~~
> >> | In file included from /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:21,
> >> |                  from /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:3:
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c: At top level:
> >> | /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:182:43: error: expected ',' or ';' before 'KBUILD_MODFILE'
> >> |   182 | #define MODULE_FILE     MODULE_INFO(file, KBUILD_MODFILE);
> >> |       |                                           ^~~~~~~~~~~~~~
> >> | /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/moduleparam.h:26:61: note: in definition of macro '__MODULE_INFO'
> >> |    26 |                 = __MODULE_INFO_PREFIX __stringify(tag) "=" info
> >> |       |                                                             ^~~~
> >> | /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:182:25: note: in expansion of macro 'MODULE_INFO'
> >> |   182 | #define MODULE_FILE     MODULE_INFO(file, KBUILD_MODFILE);
> >> |       |                         ^~~~~~~~~~~
> >> | /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:229:34: note: in expansion of macro 'MODULE_FILE'
> >> |   229 | #define MODULE_LICENSE(_license) MODULE_FILE MODULE_INFO(license, _license)
> >> |       |                                  ^~~~~~~~~~~
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:156:1: note: in expansion of macro 'MODULE_LICENSE'
> >> |   156 | MODULE_LICENSE("GPL");
> >> |       | ^~~~~~~~~~~~~~
> >>
> >> at least with oe-core/master, will check with older kernel in dunfell next.
> >>
> >> On Fri, Jul 23, 2021 at 2:46 PM Martin Jansa via lists.yoctoproject.org <Martin.Jansa=gmail.com@...> wrote:
> >>>
> >>> * fixes:
> >>>   ERROR: uxen-guest-tools-4.1.7-r0 do_patch: Command Error: 'quilt --quiltrc /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
> >>>   stdout: Applying patch fix-Makefile-for-OE-kernel-build.patch
> >>>   patching file Makefile
> >>>   Hunk #1 FAILED at 1 (different line endings).
> >>>   Hunk #2 FAILED at 19 (different line endings).
> >>>   2 out of 2 hunks FAILED -- rejects in file Makefile
> >>>   Patch fix-Makefile-for-OE-kernel-build.patch does not apply (enforce with -f)
> >>>
> >>> Signed-off-by: Martin Jansa <Martin.Jansa@...>
> >>> ---
> >>>  recipes-extended/uxen/uxen-guest-tools_4.1.7.bb | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb b/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
> >>> index 757f1e3..4dcfe51 100644
> >>> --- a/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
> >>> +++ b/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
> >>> @@ -19,4 +19,4 @@ LIC_FILES_CHKSUM = "file://../Bromium-4.1.8-Open-Source-Software.pdf;md5=cf120df
> >>>
> >>>  S = "${WORKDIR}/uxen-vmsupport-linux-${PV}"
> >>>
> >>> -inherit module
> >>> +inherit module dos2unix
> >>> --
> >>> 2.30.2
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >
> >
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II




Re: [hardknott][PATCH] oci-runtime-spec: fix url

Bruce Ashfield
 

On Fri, Dec 3, 2021 at 9:36 AM Stefan Müller-Klieser
<s.mueller-klieser@...> wrote:

On 03.12.21 15:07, Bruce Ashfield wrote:
Since we already have these changes in master, this is fundamentally a
cherrypick / backport request.
true, I did not follow, sorry


There are a couple of larger/group patches for the protocol and branch
changes, but there's an individual one for the switch to main.

I cherry-picked and modified everything, and pushed it to
hardknott-next .. have a look and let me know if anything needs
adjustment.
I just put hardknott-next in the build and it looks good. That is all I
needed. Thanks a lot for the quick reply and the quick fix! Have a good
weekend!
Good enough for me! I've pushed -next to hardknott.

Bruce


Cheers, Stefan


Bruce

On Fri, Dec 3, 2021 at 8:04 AM Stefan Mueller-Klieser
<S.Mueller-Klieser@...> wrote:

Upstream renamed master to main and github will remove the git protocol.

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@...>
---
recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
index c4083c09d818..99f309772310 100644
--- a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
+++ b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=b355a61a394a504dacde901c9
SRCNAME = "runtime-spec"

PKG_NAME = "github.com/opencontainers/${SRCNAME}"
-SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+SRC_URI = "git://${PKG_NAME}.git;branch=main;protocol=https;destsuffix=git/src/${PKG_NAME}"

SRCREV = "78ab98c0761136f84e6e21b24b4dcd0be68ab782"
PV = "v1.0.1+git${SRCPV}"
--
2.20.1



--
Dipl.-Phys. Stefan Müller-Klieser
-Gruppenleiter Software-
Tel.: +49 (0)6131 9221-0
s.mueller-klieser@...
www.phytec.de

Sie finden uns auch auf: Facebook, LinkedIn, Xing, YouTube

PHYTEC Messtechnik GmbH | Robert-Koch-Str. 39 | 55129 Mainz, Germany
Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber |
Handelsregister Mainz HRB 4656 | Finanzamt Mainz| St.Nr. 266500608, DE
149059855
This E-Mail may contain confidential or privileged information. If you
are not the intended recipient (or have received this E-Mail in error)
please notify the sender immediately and destroy this E-Mail. Any
unauthorized copying, disclosure or distribution of the material in
this E-Mail is strictly forbidden.


--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


Re: [hardknott][PATCH] oci-runtime-spec: fix url

Stefan Mueller-Klieser
 

On 03.12.21 15:07, Bruce Ashfield wrote:
Since we already have these changes in master, this is fundamentally a
cherrypick / backport request.
true, I did not follow, sorry


There are a couple of larger/group patches for the protocol and branch
changes, but there's an individual one for the switch to main.

I cherry-picked and modified everything, and pushed it to
hardknott-next .. have a look and let me know if anything needs
adjustment.
I just put hardknott-next in the build and it looks good. That is all I
needed. Thanks a lot for the quick reply and the quick fix! Have a good
weekend!

Cheers, Stefan


Bruce

On Fri, Dec 3, 2021 at 8:04 AM Stefan Mueller-Klieser
<S.Mueller-Klieser@...> wrote:

Upstream renamed master to main and github will remove the git protocol.

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@...>
---
recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
index c4083c09d818..99f309772310 100644
--- a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
+++ b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=b355a61a394a504dacde901c9
SRCNAME = "runtime-spec"

PKG_NAME = "github.com/opencontainers/${SRCNAME}"
-SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+SRC_URI = "git://${PKG_NAME}.git;branch=main;protocol=https;destsuffix=git/src/${PKG_NAME}"

SRCREV = "78ab98c0761136f84e6e21b24b4dcd0be68ab782"
PV = "v1.0.1+git${SRCPV}"
--
2.20.1


--
Dipl.-Phys. Stefan Müller-Klieser
-Gruppenleiter Software-
Tel.: +49 (0)6131 9221-0
s.mueller-klieser@...
www.phytec.de

Sie finden uns auch auf: Facebook, LinkedIn, Xing, YouTube

PHYTEC Messtechnik GmbH | Robert-Koch-Str. 39 | 55129 Mainz, Germany
Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber |
Handelsregister Mainz HRB 4656 | Finanzamt Mainz| St.Nr. 266500608, DE
149059855
This E-Mail may contain confidential or privileged information. If you
are not the intended recipient (or have received this E-Mail in error)
please notify the sender immediately and destroy this E-Mail. Any
unauthorized copying, disclosure or distribution of the material in
this E-Mail is strictly forbidden.


Re: [hardknott][PATCH] oci-runtime-spec: fix url

Bruce Ashfield
 

Since we already have these changes in master, this is fundamentally a
cherrypick / backport request.

There are a couple of larger/group patches for the protocol and branch
changes, but there's an individual one for the switch to main.

I cherry-picked and modified everything, and pushed it to
hardknott-next .. have a look and let me know if anything needs
adjustment.

Bruce

On Fri, Dec 3, 2021 at 8:04 AM Stefan Mueller-Klieser
<S.Mueller-Klieser@...> wrote:

Upstream renamed master to main and github will remove the git protocol.

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@...>
---
recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
index c4083c09d818..99f309772310 100644
--- a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
+++ b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=b355a61a394a504dacde901c9
SRCNAME = "runtime-spec"

PKG_NAME = "github.com/opencontainers/${SRCNAME}"
-SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+SRC_URI = "git://${PKG_NAME}.git;branch=main;protocol=https;destsuffix=git/src/${PKG_NAME}"

SRCREV = "78ab98c0761136f84e6e21b24b4dcd0be68ab782"
PV = "v1.0.1+git${SRCPV}"
--
2.20.1




--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


[hardknott][PATCH] oci-runtime-spec: fix url

Stefan Mueller-Klieser
 

Upstream renamed master to main and github will remove the git protocol.

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@...>
---
recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
index c4083c09d818..99f309772310 100644
--- a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
+++ b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=b355a61a394a504dacde901c9
SRCNAME = "runtime-spec"

PKG_NAME = "github.com/opencontainers/${SRCNAME}"
-SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+SRC_URI = "git://${PKG_NAME}.git;branch=main;protocol=https;destsuffix=git/src/${PKG_NAME}"

SRCREV = "78ab98c0761136f84e6e21b24b4dcd0be68ab782"
PV = "v1.0.1+git${SRCPV}"
--
2.20.1


Re: [PATCH] qemu-package-split.inc: Correct a typo

Bruce Ashfield
 

In message: [meta-virtualization] [PATCH] qemu-package-split.inc: Correct a typo
on 01/12/2021 Peter Kjellerstedt wrote:

I had noticed this myself, and swear that I fixed it .. but I can't
find any trace of the change now.

This is merged.

Bruce

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@...>
---
recipes-devtools/qemu/qemu-package-split.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-devtools/qemu/qemu-package-split.inc b/recipes-devtools/qemu/qemu-package-split.inc
index f9db331..f1d8932 100644
--- a/recipes-devtools/qemu/qemu-package-split.inc
+++ b/recipes-devtools/qemu/qemu-package-split.inc
@@ -10,7 +10,7 @@ PACKAGES:prepend:class-target = "${PN}-x86_64 \
"

FILES:${PN}-x86_64:class-target = "${bindir}/qemu-system-x86_64 ${bindir}/qemu-x86_64"
-RDEPENDS:${PN}-x86_64:append:class_target = "${PN}"
+RDEPENDS:${PN}-x86_64:append:class-target = "${PN}"
INSANE_SKIP:${PN}-x86_64:class-target = "file-rdeps"

FILES:${PN}-i386:class-target = "${bindir}/qemu-i386"



Re: [hardknott][PATCH 01/13] uxen: update guest tools to 4.1.8

Bruce Ashfield
 

all 13 are merged to hardknott.

Bruce

In message: [meta-virtualization][hardknott][PATCH 01/13] uxen: update guest tools to 4.1.8
on 01/12/2021 Martin Jansa wrote:

From: Bruce Ashfield <bruce.ashfield@...>

Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
...xen-guest-tools_4.1.7.bb => uxen-guest-tools_4.1.8.bb} | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
rename recipes-extended/uxen/{uxen-guest-tools_4.1.7.bb => uxen-guest-tools_4.1.8.bb} (63%)

diff --git a/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
similarity index 63%
rename from recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
rename to recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
index 4dcfe51..2ca0cb1 100644
--- a/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
+++ b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
@@ -6,17 +6,17 @@ LICENSE = "GPLv2"
COMPATIBLE_HOST = '(x86_64.*).*-linux'

SRC_URI = " \
- https://www.bromium.com/wp-content/uploads/2019/06/uxen-vmsupport-linux-${PV}.zip;name=uxen \
+ https://www.bromium.com/wp-content/uploads/2019/11/uxen-${PV}.zip;name=uxen \
https://www.bromium.com/wp-content/uploads/2019/11/Bromium-4.1.8-Open-Source-Software.pdf;name=license \
file://fix-Makefile-for-OE-kernel-build.patch \
"

-SRC_URI[uxen.sha384sum] = "d9d7a1fa5c44ac77eea3d8d4756f9e07fc02acfe12606325ff0bb8a60c07abc3e9ddb80c2039797fb2122d750219722f"
+SRC_URI[uxen.sha384sum] = "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5ce996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4"
SRC_URI[license.sha384sum] = "92e48c614df3094cb52321d4c4e01f6df5526d46aee5c6fa36c43ee23d4c33f03baa1fc5f6f29efafff636b6d13bc92c"

# The software license is GPLv2: please see page 199 of the pdf document
-LIC_FILES_CHKSUM = "file://../Bromium-4.1.8-Open-Source-Software.pdf;md5=cf120df6ffa417b36f870a9997650049"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/Bromium-4.1.8-Open-Source-Software.pdf;md5=cf120df6ffa417b36f870a9997650049"

-S = "${WORKDIR}/uxen-vmsupport-linux-${PV}"
+S = "${WORKDIR}/uxen-${PV}-72a4af9/vm-support/linux"

inherit module dos2unix
--
2.32.0


Re: [honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+

Bruce Ashfield
 

5/5 are now merged to honister.

Thanks!

Bruce

In message: [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+
on 01/12/2021 Martin Jansa wrote:

From: Bruce Ashfield <bruce.ashfield@...>

This is a compile only fix to update the uxen kernel modules to
work against newer kernels.

Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
...m-support-fix-build-for-kernel-s-5.4.patch | 97 +++++++++++++++++++
.../uxen/uxen-guest-tools_4.1.8.bb | 1 +
2 files changed, 98 insertions(+)
create mode 100644 recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch

diff --git a/recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch b/recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch
new file mode 100644
index 0000000..a3325ce
--- /dev/null
+++ b/recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch
@@ -0,0 +1,97 @@
+From 21bb6953a64390dd1c5a8b7520eb5e2c18ea3ff1 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@...>
+Date: Mon, 29 Nov 2021 21:01:03 -0500
+Subject: [PATCH] vm-support: fix build for kernel's > 5.4
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
+---
+ a/uxenhc/hypercall.c | 10 +++++++++-
+ a/v4vvsock/v4v_vsock.c | 2 ++
+ a/vmdiagnostics/vm_diagnostics.c | 9 ++++++++-
+ 3 files changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/uxenhc/hypercall.c b/uxenhc/hypercall.c
+index 0b9ef3f..04957a8 100644
+--- a/uxenhc/hypercall.c
++++ b/uxenhc/hypercall.c
+@@ -10,6 +10,7 @@
+ #include <linux/mm.h>
+ #include <linux/spinlock.h>
+ #include <linux/compiler.h>
++#include <linux/version.h>
+
+ #include <xen/xen.h>
+ #include <xen/version.h>
+@@ -124,7 +125,11 @@ static int __init uxen_hypercall_init(void)
+ printk(KERN_INFO "using uxen hypervisor\n");
+
+ if (!uxen_hcbase) {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0))
+ uxen_hcbase = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);
++#else
++ uxen_hcbase = __vmalloc(PAGE_SIZE, GFP_KERNEL);
++#endif
+ if (!uxen_hcbase) {
+ ret = -ENOMEM;
+ goto out;
+@@ -149,8 +154,11 @@ static void __exit uxen_hypercall_exit(void)
+ {
+ }
+
++
++#define KBUILD_MODFILE "uxenhc"
++
+ module_init(uxen_hypercall_init);
+ module_exit(uxen_hypercall_exit);
++MODULE_LICENSE("GPL");
+ MODULE_AUTHOR("paulian.marinca@...");
+ MODULE_DESCRIPTION("uXen hypercall support");
+-MODULE_LICENSE("GPL");
+diff --git a/v4vvsock/v4v_vsock.c b/v4vvsock/v4v_vsock.c
+index 8d80d7d..cd7e8ce 100644
+--- a/v4vvsock/v4v_vsock.c
++++ b/v4vvsock/v4v_vsock.c
+@@ -578,8 +578,10 @@ static const struct proto_ops vsock_dgram_ops = {
+ .ioctl = sock_no_ioctl,
+ .listen = sock_no_listen,
+ .shutdown = sock_no_shutdown,
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
+ .setsockopt = sock_no_setsockopt,
+ .getsockopt = sock_no_getsockopt,
++#endif
+ .sendmsg = vsock_sendmsg,
+ .recvmsg = vsock_recvmsg,
+ .mmap = sock_no_mmap,
+diff --git a/vmdiagnostics/vm_diagnostics.c b/vmdiagnostics/vm_diagnostics.c
+index 9ff94fb..db14e57 100644
+--- a/vmdiagnostics/vm_diagnostics.c
++++ b/vmdiagnostics/vm_diagnostics.c
+@@ -22,6 +22,7 @@
+ #include <linux/timekeeping.h>
+ #include <linux/types.h>
+ #include <linux/vmstat.h>
++#include <linux/version.h>
+
+ #include <uxen-v4vlib.h>
+
+@@ -403,10 +404,16 @@ static void vm_handle_request_stat_task(struct vm_diagnostics_context *context,
+
+ task_payload.state = task_state_to_char(task);
+ task_payload.num_threads = get_nr_threads(task);
++
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0))
+ task_payload.start_time_nsec = task->real_start_time;
++#else
++ task_payload.start_time_nsec = task->start_boottime;
++#endif
++
+ task_payload.last_run_cpu_id = task_cpu(task);
+
+- thread_group_cputime_adjusted(task, &user_nsec, &system_nsec);
++ //thread_group_cputime_adjusted(task, &user_nsec, &system_nsec);
+ task_payload.user_nsec = user_nsec;
+ task_payload.system_nsec = system_nsec;
+
+--
+2.19.1
+
diff --git a/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
index 2ca0cb1..06dc376 100644
--- a/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
+++ b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
@@ -9,6 +9,7 @@ SRC_URI = " \
https://www.bromium.com/wp-content/uploads/2019/11/uxen-${PV}.zip;name=uxen \
https://www.bromium.com/wp-content/uploads/2019/11/Bromium-4.1.8-Open-Source-Software.pdf;name=license \
file://fix-Makefile-for-OE-kernel-build.patch \
+ file://0001-vm-support-fix-build-for-kernel-s-5.4.patch \
"

SRC_URI[uxen.sha384sum] = "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5ce996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4"
--
2.32.0


[hardknott][PATCH 13/13] dev86: don't require dev86-native to build dev86

Martin Jansa
 

From: Ross Burton <ross@...>

Instead of installing binaries and patching the makefiles to run external commands, simply
build ifdef using BUILD_CC instead of CC.

This patch is now upstreamable, the recipe is less complicated, and nativesdk works.

Signed-off-by: Ross Burton <ross.burton@...>
Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
...efg-from-dev86-native-instead-of-tar.patch | 36 -------------------
recipes-extended/dev86/dev86/cross.patch | 29 +++++++++++++++
recipes-extended/dev86/dev86_git.bb | 12 ++-----
3 files changed, 32 insertions(+), 45 deletions(-)
delete mode 100644 recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch
create mode 100644 recipes-extended/dev86/dev86/cross.patch

diff --git a/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch b/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch
deleted file mode 100644
index 52d5d59..0000000
--- a/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 9b347a5ee9604d4ec972506328ee44a0d8eb1bf0 Mon Sep 17 00:00:00 2001
-From: Martin Jansa <Martin.Jansa@...>
-Date: Fri, 14 May 2021 06:32:02 -0700
-Subject: [PATCH] Makefile: use ifdefg from dev86-native instead of target
-
-* recipe is restricted to:
- COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
- so it's less likely to reproduce invalid combination of
- host and target, but I guess if you have aarch64 build
- machine and build for x86 then it might fail as for Bruce:
-
-| ./ifdefg -MU makefile.in >tmp.mak
-| /bin/sh: 1: ./ifdefg: not found
-| make[1]: *** [Makefile:46: make.fil] Error 127
-
- use ifdefg from native build to increase chances that it
- will be compatible with your host system
-
-Signed-off-by: Martin Jansa <Martin.Jansa@...>
----
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index 8a61b65..7fdf861 100644
---- a/Makefile
-+++ b/Makefile
-@@ -43,7 +43,7 @@ realclean:
- -for X in */; do cd $$X && make clean; cd $(WD); done
-
- make.fil: $(IFDEFNAME) makefile.in
-- ./$(IFDEFNAME) -MU $(IFDEFOPTS) makefile.in >tmp.mak
-+ $(IFDEFNAME) -MU $(IFDEFOPTS) makefile.in >tmp.mak
- echo > tmp.sed
- [ "$(BINDIR)" != "//bin" ] || echo >> tmp.sed "s:%BINDIR%:/bin:"
- [ "$(LIBDIR)" != "//lib/bcc" ] || echo >> tmp.sed "s:%LIBDIR%:/lib/bcc:"
diff --git a/recipes-extended/dev86/dev86/cross.patch b/recipes-extended/dev86/dev86/cross.patch
new file mode 100644
index 0000000..041a8d3
--- /dev/null
+++ b/recipes-extended/dev86/dev86/cross.patch
@@ -0,0 +1,29 @@
+Build ifdef using BUILD_CC, not CC.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@...>
+
+diff --git a/Makefile b/Makefile
+index 8a61b65..99f41de 100644
+--- a/Makefile
++++ b/Makefile
+@@ -22,6 +22,10 @@ CFLAGS= -O
+ IFDEFNAME= ifdef
+ WD=$(shell pwd)
+
++BUILD_CC ?= $(CC)
++BUILD_CFLAGS ?= $(CFLAGS)
++BUILD_LDFLAGS ?= $(LDFLAGS)
++
+ # Some makes take the last of a list as the default ...
+ all: make.fil
+ PATH="`pwd`/bin:$$PATH" $(MAKE) -f make.fil VERSION=$(VERSION) TOPDIR=`pwd` $@
+@@ -65,7 +69,7 @@ make.fil: $(IFDEFNAME) makefile.in
+ @rm -f tmp.mak tmp.sed
+
+ $(IFDEFNAME): ifdef.c
+- $(CC) $(IFDEFARCH) $(CFLAGS) $(IFDEFFLAGS) $(LDFLAGS) -o $(IFDEFNAME) ifdef.c
++ $(BUILD_CC) $(IFDEFARCH) $(BUILD_CFLAGS) $(IFDEFFLAGS) $(BUILD_LDFLAGS) -o $(IFDEFNAME) ifdef.c
+
+ uninstall:
+ @echo 'Sorry, no go; it was just wrong.'
diff --git a/recipes-extended/dev86/dev86_git.bb b/recipes-extended/dev86/dev86_git.bb
index ad7a0df..838918a 100644
--- a/recipes-extended/dev86/dev86_git.bb
+++ b/recipes-extended/dev86/dev86_git.bb
@@ -11,16 +11,14 @@ SRC_URI = "git://github.com/jbruchon/${BPN}.git;protocol=https \
file://0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch \
file://0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch \
file://0004-regen-token2.h-token1.h-with-gperf-3.1.patch \
-"
-SRC_URI_append_class-target = " \
- file://0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch \
+ file://cross.patch \
"

S = "${WORKDIR}/git"

-DEPENDS = "gperf-native dev86-native"
+DEPENDS = "gperf-native"

-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
EXTRA_OEMAKE = "VERSION=${BASE_PV} PREFIX=${prefix} DIST=${D} LDFLAGS='${LDFLAGS}' INEXE=''"

do_compile() {
@@ -41,8 +39,4 @@ do_install() {
ln -s ../lib/bcc/bcc-cc1 ${D}${prefix}/bin/bcc-cc1
}

-do_install_append_class-native() {
- install -v -m 755 ${B}/ifdefg ${D}${bindir}
-}
-
FILES_${PN} += "${libdir}/bcc"
--
2.32.0


[hardknott][PATCH 12/13] dev86: work on all hosts, other cleanups

Martin Jansa
 

From: Ross Burton <ross@...>

Remove COMPATIBLE_HOST, whilst this is an x86 assembler there's nothing to stop
you building it on or for arm64 and assembling x86 code.

Override INEXE so that binaries are not stripped and remove INSANE_SKIP.

Signed-off-by: Ross Burton <ross.burton@...>
Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
recipes-extended/dev86/dev86_git.bb | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/recipes-extended/dev86/dev86_git.bb b/recipes-extended/dev86/dev86_git.bb
index 9488d90..ad7a0df 100644
--- a/recipes-extended/dev86/dev86_git.bb
+++ b/recipes-extended/dev86/dev86_git.bb
@@ -21,7 +21,7 @@ S = "${WORKDIR}/git"
DEPENDS = "gperf-native dev86-native"

BBCLASSEXTEND = "native"
-EXTRA_OEMAKE = "VERSION=${BASE_PV} PREFIX=${prefix} DIST=${D} LDFLAGS='${LDFLAGS}'"
+EXTRA_OEMAKE = "VERSION=${BASE_PV} PREFIX=${prefix} DIST=${D} LDFLAGS='${LDFLAGS}' INEXE=''"

do_compile() {
# always regenerate token1.h, token2.h for deterministic behavior
@@ -45,7 +45,4 @@ do_install_append_class-native() {
install -v -m 755 ${B}/ifdefg ${D}${bindir}
}

-COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
FILES_${PN} += "${libdir}/bcc"
-
-INSANE_SKIP_${PN} = "already-stripped"
--
2.32.0


[hardknott][PATCH 11/13] dev86: remove the pre-generated token[12].h and force gperf to generate them in do_compile

Martin Jansa
 

Signed-off-by: Martin Jansa <Martin.Jansa@...>
---
...1.tok-to-make-new-gperf-happy-regen..patch | 230 +-----------
...gen-token2.h-token1.h-with-gperf-3.1.patch | 332 +-----------------
recipes-extended/dev86/dev86_git.bb | 2 +
3 files changed, 5 insertions(+), 559 deletions(-)

diff --git a/recipes-extended/dev86/dev86/0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch b/recipes-extended/dev86/dev86/0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch
index 38e4d81..47c283b 100644
--- a/recipes-extended/dev86/dev86/0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch
+++ b/recipes-extended/dev86/dev86/0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch
@@ -8,239 +8,13 @@ Signed-off-by: Martin Jansa <Martin.Jansa@...>
Upstream-Status: Pending [it was submitted in https://github.com/jbruchon/dev86/pull/19
but then closed by author]

+Remove regenerated token1.h as we'll force it to regenerate in do_compile.
+
---
cpp/token1.h | 170 +++++++++++++++++++++++++++++++++----------------
cpp/token1.tok | 2 +-
2 files changed, 115 insertions(+), 57 deletions(-)

-diff --git a/cpp/token1.h b/cpp/token1.h
-index 2e2b9eb..bb313aa 100644
---- a/cpp/token1.h
-+++ b/cpp/token1.h
-@@ -1,15 +1,48 @@
--/* C code produced by gperf version 2.7.1 (19981006 egcs) */
-+/* C code produced by gperf version 3.0.4 */
- /* Command-line: gperf -aptTc -N is_ctok -H hash1 token1.tok */
-+/* Computed positions: -k'1-2' */
-+
-+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
-+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
-+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
-+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
-+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
-+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
-+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
-+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
-+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
-+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
-+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
-+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
-+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
-+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
-+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
-+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
-+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
-+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
-+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
-+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
-+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
-+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
-+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
-+/* The character set is not based on ISO-646. */
-+error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@...>."
-+#endif
-+
-
- #define TOTAL_KEYWORDS 23
- #define MIN_WORD_LENGTH 2
- #define MAX_WORD_LENGTH 3
- #define MIN_HASH_VALUE 2
--#define MAX_HASH_VALUE 63
--/* maximum key range = 62, duplicates = 0 */
-+#define MAX_HASH_VALUE 62
-+/* maximum key range = 61, duplicates = 0 */
-
- #ifdef __GNUC__
- __inline
-+#else
-+#ifdef __cplusplus
-+inline
-+#endif
- #endif
- static unsigned int
- hash1 (str, len)
-@@ -18,38 +51,41 @@ hash1 (str, len)
- {
- static unsigned char asso_values[] =
- {
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 1, 64, 64, 64, 3, 25, 64,
-- 64, 64, 13, 18, 64, 8, 30, 15, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 5, 0, 20, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 30, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 23, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
-- 64, 64, 64, 64, 64, 64
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 6, 63, 63, 63, 28, 8, 63,
-+ 63, 63, 23, 3, 63, 25, 20, 18, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 10, 5, 0, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 13, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 30, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
-+ 63, 63, 63, 63, 63, 63
- };
-- return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
-+ return len + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]];
- }
-
- #ifdef __GNUC__
- __inline
-+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
-+__attribute__ ((__gnu_inline__))
-+#endif
- #endif
- struct token_trans *
- is_ctok (str, len)
-@@ -59,46 +95,68 @@ is_ctok (str, len)
- static struct token_trans wordlist[] =
- {
- {""}, {""},
-+#line 14 "token1.tok"
-+ {">>", TK_RIGHT_OP},
-+#line 4 "token1.tok"
-+ {">>=", TK_RIGHT_ASSIGN},
-+ {""}, {""}, {""},
-+#line 22 "token1.tok"
-+ {">=", TK_GE_OP},
-+#line 16 "token1.tok"
-+ {"++", TK_INC_OP},
-+ {""},
-+#line 6 "token1.tok"
-+ {"+=", TK_ADD_ASSIGN},
-+ {""},
-+#line 23 "token1.tok"
- {"==", TK_EQ_OP},
-+#line 24 "token1.tok"
- {"!=", TK_NE_OP},
- {""},
-- {"%=", TK_MOD_ASSIGN},
-+#line 11 "token1.tok"
-+ {"&=", TK_AND_ASSIGN},
- {""},
-+#line 21 "token1.tok"
- {"<=", TK_LE_OP},
-- {"<<=", TK_LEFT_ASSIGN},
-+#line 19 "token1.tok"
-+ {"&&", TK_AND_OP},
- {""},
-- {"-=", TK_SUB_ASSIGN},
-+#line 12 "token1.tok"
-+ {"^=", TK_XOR_ASSIGN},
- {""},
-+#line 15 "token1.tok"
- {"<<", TK_LEFT_OP},
-- {""}, {""},
-- {"*=", TK_MUL_ASSIGN},
-+#line 5 "token1.tok"
-+ {"<<=", TK_LEFT_ASSIGN},
- {""},
-+#line 9 "token1.tok"
- {"/=", TK_DIV_ASSIGN},
-- {"--", TK_DEC_OP},
- {""},
-- {"+=", TK_ADD_ASSIGN},
-- {""},
-- {">=", TK_GE_OP},
-- {">>=", TK_RIGHT_ASSIGN},
-- {""},
-- {"|=", TK_OR_ASSIGN},
-+#line 18 "token1.tok"
-+ {"->", TK_PTR_OP},
-+ {""}, {""},
-+#line 8 "token1.tok"
-+ {"*=", TK_MUL_ASSIGN},
- {""},
-- {"&=", TK_AND_ASSIGN},
-+#line 7 "token1.tok"
-+ {"-=", TK_SUB_ASSIGN},
- {""}, {""},
-- {"->", TK_PTR_OP},
-+#line 10 "token1.tok"
-+ {"%=", TK_MOD_ASSIGN},
- {""},
-- {"^=", TK_XOR_ASSIGN},
-- {""}, {""}, {""}, {""}, {""},
-- {"++", TK_INC_OP},
-- {""}, {""}, {""},
-- {">>", TK_RIGHT_OP},
-- {""}, {""}, {""}, {""}, {""},
-- {"||", TK_OR_OP},
-- {""}, {""}, {""},
-- {"&&", TK_AND_OP},
-- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-+#line 13 "token1.tok"
-+ {"|=", TK_OR_ASSIGN},
-+ {""}, {""}, {""}, {""},
-+#line 25 "token1.tok"
- {"..", TK_WORD},
-- {"...", TK_ELLIPSIS}
-+#line 3 "token1.tok"
-+ {"...", TK_ELLIPSIS},
-+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-+#line 17 "token1.tok"
-+ {"--", TK_DEC_OP},
-+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-+#line 20 "token1.tok"
-+ {"||", TK_OR_OP}
- };
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
-@@ -109,7 +167,7 @@ is_ctok (str, len)
- {
- register const char *s = wordlist[key].name;
-
-- if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
-+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
- return &wordlist[key];
- }
- }
diff --git a/cpp/token1.tok b/cpp/token1.tok
index cd668ce..a98926f 100644
--- a/cpp/token1.tok
diff --git a/recipes-extended/dev86/dev86/0004-regen-token2.h-token1.h-with-gperf-3.1.patch b/recipes-extended/dev86/dev86/0004-regen-token2.h-token1.h-with-gperf-3.1.patch
index 8787369..4a5bb25 100644
--- a/recipes-extended/dev86/dev86/0004-regen-token2.h-token1.h-with-gperf-3.1.patch
+++ b/recipes-extended/dev86/dev86/0004-regen-token2.h-token1.h-with-gperf-3.1.patch
@@ -9,6 +9,7 @@ Subject: [PATCH] regen token2.h, token1.h with gperf-3.1
Upstream-Status: Pending
Signed-off-by: Martin Jansa <Martin.Jansa@...>

+Remove regenerated token2.h as we'll force it to regenerate in do_compile.
---
cpp/cc.h | 4 +-
cpp/token1.c | 2 +-
@@ -44,66 +45,6 @@ index f3aa420..cc47f3e 100644
+static unsigned int hash1 P((register const char *, register size_t));

#include "token1.h"
-diff --git a/cpp/token1.h b/cpp/token1.h
-index bb313aa..2af88c2 100644
---- a/cpp/token1.h
-+++ b/cpp/token1.h
-@@ -1,4 +1,4 @@
--/* C code produced by gperf version 3.0.4 */
-+/* ANSI-C code produced by gperf version 3.1 */
- /* Command-line: gperf -aptTc -N is_ctok -H hash1 token1.tok */
- /* Computed positions: -k'1-2' */
-
-@@ -26,7 +26,7 @@
- && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
- && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
- /* The character set is not based on ISO-646. */
--error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@...>."
-+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@...>."
- #endif
-
-
-@@ -45,9 +45,7 @@ inline
- #endif
- #endif
- static unsigned int
--hash1 (str, len)
-- register const char *str;
-- register unsigned int len;
-+hash1 (register const char *str, register size_t len)
- {
- static unsigned char asso_values[] =
- {
-@@ -81,16 +79,8 @@ hash1 (str, len)
- return len + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]];
- }
-
--#ifdef __GNUC__
--__inline
--#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
--__attribute__ ((__gnu_inline__))
--#endif
--#endif
- struct token_trans *
--is_ctok (str, len)
-- register const char *str;
-- register unsigned int len;
-+is_ctok (register const char *str, register size_t len)
- {
- static struct token_trans wordlist[] =
- {
-@@ -161,9 +151,9 @@ is_ctok (str, len)
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
-- register int key = hash1 (str, len);
-+ register unsigned int key = hash1 (str, len);
-
-- if (key <= MAX_HASH_VALUE && key >= 0)
-+ if (key <= MAX_HASH_VALUE)
- {
- register const char *s = wordlist[key].name;
-
diff --git a/cpp/token2.c b/cpp/token2.c
index b4d22b1..fbc790d 100644
--- a/cpp/token2.c
@@ -116,274 +57,3 @@ index b4d22b1..fbc790d 100644
+static unsigned int hash2 P((register const char *, register size_t));

#include "token2.h"
-diff --git a/cpp/token2.h b/cpp/token2.h
-index 62e69b1..f7ac2fd 100644
---- a/cpp/token2.h
-+++ b/cpp/token2.h
-@@ -1,57 +1,87 @@
--/* C code produced by gperf version 2.7.1 (19981006 egcs) */
-+/* ANSI-C code produced by gperf version 3.1 */
- /* Command-line: gperf -aptTc -k1,3 -N is_ckey -H hash2 token2.tok */
-
-+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
-+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
-+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
-+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
-+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
-+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
-+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
-+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
-+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
-+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
-+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
-+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
-+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
-+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
-+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
-+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
-+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
-+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
-+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
-+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
-+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
-+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
-+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
-+/* The character set is not based on ISO-646. */
-+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@...>."
-+#endif
-+
-+
- #define TOTAL_KEYWORDS 34
- #define MIN_WORD_LENGTH 2
- #define MAX_WORD_LENGTH 8
--#define MIN_HASH_VALUE 2
--#define MAX_HASH_VALUE 69
--/* maximum key range = 68, duplicates = 0 */
-+#define MIN_HASH_VALUE 3
-+#define MAX_HASH_VALUE 44
-+/* maximum key range = 42, duplicates = 0 */
-
- #ifdef __GNUC__
- __inline
-+#else
-+#ifdef __cplusplus
-+inline
-+#endif
- #endif
- static unsigned int
--hash2 (str, len)
-- register const char *str;
-- register unsigned int len;
-+hash2 (register const char *str, register size_t len)
- {
- static unsigned char asso_values[] =
- {
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 5, 70, 70, 70, 70, 70, 0, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 0, 70, 5, 5, 10,
-- 10, 20, 20, 25, 70, 0, 70, 70, 50, 70,
-- 0, 15, 0, 70, 15, 0, 40, 20, 0, 0,
-- 70, 70, 10, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
-- 70, 70, 70, 70, 70, 70
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 25, 45, 45, 45, 45, 45, 10, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 5, 45, 30, 10, 10,
-+ 25, 20, 0, 10, 45, 5, 45, 45, 25, 45,
-+ 10, 10, 5, 45, 0, 5, 0, 0, 0, 20,
-+ 45, 45, 25, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-+ 45, 45, 45, 45, 45, 45
- };
-- register int hval = len;
-+ register unsigned int hval = len;
-
- switch (hval)
- {
- default:
-- case 3:
- hval += asso_values[(unsigned char)str[2]];
-+ /*FALLTHROUGH*/
- case 2:
- case 1:
- hval += asso_values[(unsigned char)str[0]];
-@@ -60,78 +90,97 @@ hash2 (str, len)
- return hval;
- }
-
--#ifdef __GNUC__
--__inline
--#endif
- struct token_trans *
--is_ckey (str, len)
-- register const char *str;
-- register unsigned int len;
-+is_ckey (register const char *str, register size_t len)
- {
- static struct token_trans wordlist[] =
- {
-+ {""}, {""}, {""},
-+#line 16 "token2.tok"
-+ {"for", TK_FOR},
- {""}, {""},
-+#line 22 "token2.tok"
-+ {"return", TK_RETURN},
-+#line 18 "token2.tok"
- {"if", TK_IF},
-- {""},
-+#line 19 "token2.tok"
-+ {"int", TK_INT},
-+#line 32 "token2.tok"
- {"void", TK_VOID},
-- {"while", TK_WHILE},
-+#line 30 "token2.tok"
-+ {"union", TK_UNION},
-+#line 27 "token2.tok"
-+ {"struct", TK_STRUCT},
-+#line 29 "token2.tok"
-+ {"typedef", TK_TYPEDEF},
-+#line 31 "token2.tok"
-+ {"unsigned", TK_UNSIGNED},
-+#line 17 "token2.tok"
-+ {"goto", TK_GOTO},
-+#line 15 "token2.tok"
-+ {"float", TK_FLOAT},
-+#line 28 "token2.tok"
- {"switch", TK_SWITCH},
- {""},
-- {"__LINE__", TK_LINE},
-- {""}, {""},
-- {"static", TK_STATIC},
-- {"do", TK_DO},
-- {"__FILE__", TK_FILE},
-+#line 21 "token2.tok"
-+ {"register", TK_REGISTER},
-+#line 5 "token2.tok"
- {"case", TK_CASE},
-- {"const", TK_CONST},
-- {"sizeof", TK_SIZEOF},
-+#line 23 "token2.tok"
-+ {"short", TK_SHORT},
-+#line 24 "token2.tok"
-+ {"signed", TK_SIGNED},
- {""},
-+#line 36 "token2.tok"
-+ {"__LINE__", TK_LINE},
-+#line 13 "token2.tok"
-+ {"enum", TK_ENUM},
-+#line 7 "token2.tok"
-+ {"const", TK_CONST},
-+#line 14 "token2.tok"
-+ {"extern", TK_EXTERN},
-+#line 10 "token2.tok"
-+ {"do", TK_DO},
-+#line 8 "token2.tok"
- {"continue", TK_CONTINUE},
-- {"char", TK_CHAR},
-- {"short", TK_SHORT},
-- {"struct", TK_STRUCT},
-- {""}, {""},
-+#line 12 "token2.tok"
- {"else", TK_ELSE},
-- {"union", TK_UNION},
-- {""}, {""},
-- {"unsigned", TK_UNSIGNED},
-- {""},
-- {"break", TK_BREAK},
-- {"signed", TK_SIGNED},
-- {""}, {""}, {""}, {""},
-+#line 34 "token2.tok"
-+ {"while", TK_WHILE},
-+#line 11 "token2.tok"
- {"double", TK_DOUBLE},
-+#line 9 "token2.tok"
- {"default", TK_DEFAULT},
-- {"for", TK_FOR},
-- {""},
-- {"float", TK_FLOAT},
-- {""}, {""},
-- {"int", TK_INT},
-- {"enum", TK_ENUM},
-- {""}, {""},
-- {"typedef", TK_TYPEDEF},
-- {"register", TK_REGISTER},
-+#line 33 "token2.tok"
-+ {"volatile", TK_VOLATILE},
-+#line 3 "token2.tok"
- {"auto", TK_AUTO},
-- {""}, {""}, {""}, {""},
-+#line 4 "token2.tok"
-+ {"break", TK_BREAK},
-+#line 25 "token2.tok"
-+ {"sizeof", TK_SIZEOF},
-+ {""},
-+#line 35 "token2.tok"
-+ {"__FILE__", TK_FILE},
-+#line 20 "token2.tok"
- {"long", TK_LONG},
-- {""}, {""}, {""},
-- {"volatile", TK_VOLATILE},
-- {""}, {""},
-- {"return", TK_RETURN},
-- {""}, {""}, {""}, {""},
-- {"extern", TK_EXTERN},
-+ {""},
-+#line 26 "token2.tok"
-+ {"static", TK_STATIC},
- {""}, {""},
-- {"goto", TK_GOTO}
-+#line 6 "token2.tok"
-+ {"char", TK_CHAR}
- };
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
-- register int key = hash2 (str, len);
-+ register unsigned int key = hash2 (str, len);
-
-- if (key <= MAX_HASH_VALUE && key >= 0)
-+ if (key <= MAX_HASH_VALUE)
- {
- register const char *s = wordlist[key].name;
-
-- if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
-+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
- return &wordlist[key];
- }
- }
diff --git a/recipes-extended/dev86/dev86_git.bb b/recipes-extended/dev86/dev86_git.bb
index a5f40fa..9488d90 100644
--- a/recipes-extended/dev86/dev86_git.bb
+++ b/recipes-extended/dev86/dev86_git.bb
@@ -24,6 +24,8 @@ BBCLASSEXTEND = "native"
EXTRA_OEMAKE = "VERSION=${BASE_PV} PREFIX=${prefix} DIST=${D} LDFLAGS='${LDFLAGS}'"

do_compile() {
+ # always regenerate token1.h, token2.h for deterministic behavior
+ rm -f ${S}/cpp/token1.h ${S}/cpp/token2.h
oe_runmake make.fil
oe_runmake -f make.fil bcc86 as86 ld86
}
--
2.32.0


[hardknott][PATCH 10/13] dev86: fix compatibility with gperf-3.1

Martin Jansa
 

Signed-off-by: Martin Jansa <Martin.Jansa@...>
---
...1.tok-to-make-new-gperf-happy-regen..patch | 256 ++++++++++++
...gen-token2.h-token1.h-with-gperf-3.1.patch | 389 ++++++++++++++++++
recipes-extended/dev86/dev86_git.bb | 2 +
3 files changed, 647 insertions(+)
create mode 100644 recipes-extended/dev86/dev86/0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch
create mode 100644 recipes-extended/dev86/dev86/0004-regen-token2.h-token1.h-with-gperf-3.1.patch

diff --git a/recipes-extended/dev86/dev86/0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch b/recipes-extended/dev86/dev86/0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch
new file mode 100644
index 0000000..38e4d81
--- /dev/null
+++ b/recipes-extended/dev86/dev86/0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch
@@ -0,0 +1,256 @@
+From e908a3ad04bb40e425542b85fbb3a1eb5a38e194 Mon Sep 17 00:00:00 2001
+From: Tee-Kiah Chia <tkchia@...>
+Date: Thu, 27 Feb 2020 00:52:05 +0800
+Subject: [PATCH] [cpp] update token1.tok to make new gperf happy; regen.
+ token1.h
+
+Signed-off-by: Martin Jansa <Martin.Jansa@...>
+Upstream-Status: Pending [it was submitted in https://github.com/jbruchon/dev86/pull/19
+but then closed by author]
+
+---
+ cpp/token1.h | 170 +++++++++++++++++++++++++++++++++----------------
+ cpp/token1.tok | 2 +-
+ 2 files changed, 115 insertions(+), 57 deletions(-)
+
+diff --git a/cpp/token1.h b/cpp/token1.h
+index 2e2b9eb..bb313aa 100644
+--- a/cpp/token1.h
++++ b/cpp/token1.h
+@@ -1,15 +1,48 @@
+-/* C code produced by gperf version 2.7.1 (19981006 egcs) */
++/* C code produced by gperf version 3.0.4 */
+ /* Command-line: gperf -aptTc -N is_ctok -H hash1 token1.tok */
++/* Computed positions: -k'1-2' */
++
++#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
++ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
++ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
++ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
++ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
++ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
++ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
++ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
++ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
++ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
++ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
++ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
++ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
++ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
++ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
++ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
++ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
++ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
++ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
++ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
++ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
++ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
++ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
++/* The character set is not based on ISO-646. */
++error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@...>."
++#endif
++
+
+ #define TOTAL_KEYWORDS 23
+ #define MIN_WORD_LENGTH 2
+ #define MAX_WORD_LENGTH 3
+ #define MIN_HASH_VALUE 2
+-#define MAX_HASH_VALUE 63
+-/* maximum key range = 62, duplicates = 0 */
++#define MAX_HASH_VALUE 62
++/* maximum key range = 61, duplicates = 0 */
+
+ #ifdef __GNUC__
+ __inline
++#else
++#ifdef __cplusplus
++inline
++#endif
+ #endif
+ static unsigned int
+ hash1 (str, len)
+@@ -18,38 +51,41 @@ hash1 (str, len)
+ {
+ static unsigned char asso_values[] =
+ {
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 1, 64, 64, 64, 3, 25, 64,
+- 64, 64, 13, 18, 64, 8, 30, 15, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 5, 0, 20, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 30, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 23, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+- 64, 64, 64, 64, 64, 64
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 6, 63, 63, 63, 28, 8, 63,
++ 63, 63, 23, 3, 63, 25, 20, 18, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 10, 5, 0, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 13, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 30, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
++ 63, 63, 63, 63, 63, 63
+ };
+- return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
++ return len + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]];
+ }
+
+ #ifdef __GNUC__
+ __inline
++#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
++__attribute__ ((__gnu_inline__))
++#endif
+ #endif
+ struct token_trans *
+ is_ctok (str, len)
+@@ -59,46 +95,68 @@ is_ctok (str, len)
+ static struct token_trans wordlist[] =
+ {
+ {""}, {""},
++#line 14 "token1.tok"
++ {">>", TK_RIGHT_OP},
++#line 4 "token1.tok"
++ {">>=", TK_RIGHT_ASSIGN},
++ {""}, {""}, {""},
++#line 22 "token1.tok"
++ {">=", TK_GE_OP},
++#line 16 "token1.tok"
++ {"++", TK_INC_OP},
++ {""},
++#line 6 "token1.tok"
++ {"+=", TK_ADD_ASSIGN},
++ {""},
++#line 23 "token1.tok"
+ {"==", TK_EQ_OP},
++#line 24 "token1.tok"
+ {"!=", TK_NE_OP},
+ {""},
+- {"%=", TK_MOD_ASSIGN},
++#line 11 "token1.tok"
++ {"&=", TK_AND_ASSIGN},
+ {""},
++#line 21 "token1.tok"
+ {"<=", TK_LE_OP},
+- {"<<=", TK_LEFT_ASSIGN},
++#line 19 "token1.tok"
++ {"&&", TK_AND_OP},
+ {""},
+- {"-=", TK_SUB_ASSIGN},
++#line 12 "token1.tok"
++ {"^=", TK_XOR_ASSIGN},
+ {""},
++#line 15 "token1.tok"
+ {"<<", TK_LEFT_OP},
+- {""}, {""},
+- {"*=", TK_MUL_ASSIGN},
++#line 5 "token1.tok"
++ {"<<=", TK_LEFT_ASSIGN},
+ {""},
++#line 9 "token1.tok"
+ {"/=", TK_DIV_ASSIGN},
+- {"--", TK_DEC_OP},
+ {""},
+- {"+=", TK_ADD_ASSIGN},
+- {""},
+- {">=", TK_GE_OP},
+- {">>=", TK_RIGHT_ASSIGN},
+- {""},
+- {"|=", TK_OR_ASSIGN},
++#line 18 "token1.tok"
++ {"->", TK_PTR_OP},
++ {""}, {""},
++#line 8 "token1.tok"
++ {"*=", TK_MUL_ASSIGN},
+ {""},
+- {"&=", TK_AND_ASSIGN},
++#line 7 "token1.tok"
++ {"-=", TK_SUB_ASSIGN},
+ {""}, {""},
+- {"->", TK_PTR_OP},
++#line 10 "token1.tok"
++ {"%=", TK_MOD_ASSIGN},
+ {""},
+- {"^=", TK_XOR_ASSIGN},
+- {""}, {""}, {""}, {""}, {""},
+- {"++", TK_INC_OP},
+- {""}, {""}, {""},
+- {">>", TK_RIGHT_OP},
+- {""}, {""}, {""}, {""}, {""},
+- {"||", TK_OR_OP},
+- {""}, {""}, {""},
+- {"&&", TK_AND_OP},
+- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
++#line 13 "token1.tok"
++ {"|=", TK_OR_ASSIGN},
++ {""}, {""}, {""}, {""},
++#line 25 "token1.tok"
+ {"..", TK_WORD},
+- {"...", TK_ELLIPSIS}
++#line 3 "token1.tok"
++ {"...", TK_ELLIPSIS},
++ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
++#line 17 "token1.tok"
++ {"--", TK_DEC_OP},
++ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
++#line 20 "token1.tok"
++ {"||", TK_OR_OP}
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+@@ -109,7 +167,7 @@ is_ctok (str, len)
+ {
+ register const char *s = wordlist[key].name;
+
+- if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
++ if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
+ return &wordlist[key];
+ }
+ }
+diff --git a/cpp/token1.tok b/cpp/token1.tok
+index cd668ce..a98926f 100644
+--- a/cpp/token1.tok
++++ b/cpp/token1.tok
+@@ -7,7 +7,7 @@ struct token_trans { char * name; int token; };
+ -=, TK_SUB_ASSIGN
+ *=, TK_MUL_ASSIGN
+ /=, TK_DIV_ASSIGN
+-%=, TK_MOD_ASSIGN
++"%=", TK_MOD_ASSIGN
+ &=, TK_AND_ASSIGN
+ ^=, TK_XOR_ASSIGN
+ |=, TK_OR_ASSIGN
diff --git a/recipes-extended/dev86/dev86/0004-regen-token2.h-token1.h-with-gperf-3.1.patch b/recipes-extended/dev86/dev86/0004-regen-token2.h-token1.h-with-gperf-3.1.patch
new file mode 100644
index 0000000..8787369
--- /dev/null
+++ b/recipes-extended/dev86/dev86/0004-regen-token2.h-token1.h-with-gperf-3.1.patch
@@ -0,0 +1,389 @@
+From ce2b9747d51df2a4c358a037950f0464f3f53fe8 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@...>
+Date: Fri, 14 May 2021 14:31:50 +0000
+Subject: [PATCH] regen token2.h, token1.h with gperf-3.1
+
+* update cc.h, token1.c, token2.c to be compatible with
+ gperf-3.1 output
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@...>
+
+---
+ cpp/cc.h | 4 +-
+ cpp/token1.c | 2 +-
+ cpp/token1.h | 22 ++----
+ cpp/token2.c | 2 +-
+ cpp/token2.h | 211 +++++++++++++++++++++++++++++++--------------------
+ 5 files changed, 140 insertions(+), 101 deletions(-)
+
+diff --git a/cpp/cc.h b/cpp/cc.h
+index 9c298e7..3724543 100644
+--- a/cpp/cc.h
++++ b/cpp/cc.h
+@@ -25,8 +25,8 @@ extern int dialect;
+ extern int gettok P((void));
+
+ struct token_trans { char * name; int token; };
+-struct token_trans * is_ctok P((const char *str, unsigned int len));
+-struct token_trans * is_ckey P((const char *str, unsigned int len));
++struct token_trans * is_ctok P((register const char *str, register size_t len));
++struct token_trans * is_ckey P((register const char *str, register size_t len));
+
+ #define WORDSIZE 128
+ #define TK_WSPACE 256
+diff --git a/cpp/token1.c b/cpp/token1.c
+index f3aa420..cc47f3e 100644
+--- a/cpp/token1.c
++++ b/cpp/token1.c
+@@ -6,6 +6,6 @@
+ #ifdef __GNUC__
+ __inline
+ #endif
+-static unsigned int hash1 P((register const char *, register unsigned int));
++static unsigned int hash1 P((register const char *, register size_t));
+
+ #include "token1.h"
+diff --git a/cpp/token1.h b/cpp/token1.h
+index bb313aa..2af88c2 100644
+--- a/cpp/token1.h
++++ b/cpp/token1.h
+@@ -1,4 +1,4 @@
+-/* C code produced by gperf version 3.0.4 */
++/* ANSI-C code produced by gperf version 3.1 */
+ /* Command-line: gperf -aptTc -N is_ctok -H hash1 token1.tok */
+ /* Computed positions: -k'1-2' */
+
+@@ -26,7 +26,7 @@
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+ /* The character set is not based on ISO-646. */
+-error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@...>."
++#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@...>."
+ #endif
+
+
+@@ -45,9 +45,7 @@ inline
+ #endif
+ #endif
+ static unsigned int
+-hash1 (str, len)
+- register const char *str;
+- register unsigned int len;
++hash1 (register const char *str, register size_t len)
+ {
+ static unsigned char asso_values[] =
+ {
+@@ -81,16 +79,8 @@ hash1 (str, len)
+ return len + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]];
+ }
+
+-#ifdef __GNUC__
+-__inline
+-#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+-__attribute__ ((__gnu_inline__))
+-#endif
+-#endif
+ struct token_trans *
+-is_ctok (str, len)
+- register const char *str;
+- register unsigned int len;
++is_ctok (register const char *str, register size_t len)
+ {
+ static struct token_trans wordlist[] =
+ {
+@@ -161,9 +151,9 @@ is_ctok (str, len)
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+- register int key = hash1 (str, len);
++ register unsigned int key = hash1 (str, len);
+
+- if (key <= MAX_HASH_VALUE && key >= 0)
++ if (key <= MAX_HASH_VALUE)
+ {
+ register const char *s = wordlist[key].name;
+
+diff --git a/cpp/token2.c b/cpp/token2.c
+index b4d22b1..fbc790d 100644
+--- a/cpp/token2.c
++++ b/cpp/token2.c
+@@ -6,6 +6,6 @@
+ #ifdef __GNUC__
+ __inline
+ #endif
+-static unsigned int hash2 P((register const char *, register unsigned int));
++static unsigned int hash2 P((register const char *, register size_t));
+
+ #include "token2.h"
+diff --git a/cpp/token2.h b/cpp/token2.h
+index 62e69b1..f7ac2fd 100644
+--- a/cpp/token2.h
++++ b/cpp/token2.h
+@@ -1,57 +1,87 @@
+-/* C code produced by gperf version 2.7.1 (19981006 egcs) */
++/* ANSI-C code produced by gperf version 3.1 */
+ /* Command-line: gperf -aptTc -k1,3 -N is_ckey -H hash2 token2.tok */
+
++#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
++ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
++ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
++ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
++ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
++ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
++ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
++ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
++ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
++ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
++ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
++ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
++ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
++ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
++ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
++ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
++ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
++ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
++ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
++ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
++ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
++ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
++ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
++/* The character set is not based on ISO-646. */
++#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@...>."
++#endif
++
++
+ #define TOTAL_KEYWORDS 34
+ #define MIN_WORD_LENGTH 2
+ #define MAX_WORD_LENGTH 8
+-#define MIN_HASH_VALUE 2
+-#define MAX_HASH_VALUE 69
+-/* maximum key range = 68, duplicates = 0 */
++#define MIN_HASH_VALUE 3
++#define MAX_HASH_VALUE 44
++/* maximum key range = 42, duplicates = 0 */
+
+ #ifdef __GNUC__
+ __inline
++#else
++#ifdef __cplusplus
++inline
++#endif
+ #endif
+ static unsigned int
+-hash2 (str, len)
+- register const char *str;
+- register unsigned int len;
++hash2 (register const char *str, register size_t len)
+ {
+ static unsigned char asso_values[] =
+ {
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 5, 70, 70, 70, 70, 70, 0, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 0, 70, 5, 5, 10,
+- 10, 20, 20, 25, 70, 0, 70, 70, 50, 70,
+- 0, 15, 0, 70, 15, 0, 40, 20, 0, 0,
+- 70, 70, 10, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+- 70, 70, 70, 70, 70, 70
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 25, 45, 45, 45, 45, 45, 10, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 5, 45, 30, 10, 10,
++ 25, 20, 0, 10, 45, 5, 45, 45, 25, 45,
++ 10, 10, 5, 45, 0, 5, 0, 0, 0, 20,
++ 45, 45, 25, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
++ 45, 45, 45, 45, 45, 45
+ };
+- register int hval = len;
++ register unsigned int hval = len;
+
+ switch (hval)
+ {
+ default:
+- case 3:
+ hval += asso_values[(unsigned char)str[2]];
++ /*FALLTHROUGH*/
+ case 2:
+ case 1:
+ hval += asso_values[(unsigned char)str[0]];
+@@ -60,78 +90,97 @@ hash2 (str, len)
+ return hval;
+ }
+
+-#ifdef __GNUC__
+-__inline
+-#endif
+ struct token_trans *
+-is_ckey (str, len)
+- register const char *str;
+- register unsigned int len;
++is_ckey (register const char *str, register size_t len)
+ {
+ static struct token_trans wordlist[] =
+ {
++ {""}, {""}, {""},
++#line 16 "token2.tok"
++ {"for", TK_FOR},
+ {""}, {""},
++#line 22 "token2.tok"
++ {"return", TK_RETURN},
++#line 18 "token2.tok"
+ {"if", TK_IF},
+- {""},
++#line 19 "token2.tok"
++ {"int", TK_INT},
++#line 32 "token2.tok"
+ {"void", TK_VOID},
+- {"while", TK_WHILE},
++#line 30 "token2.tok"
++ {"union", TK_UNION},
++#line 27 "token2.tok"
++ {"struct", TK_STRUCT},
++#line 29 "token2.tok"
++ {"typedef", TK_TYPEDEF},
++#line 31 "token2.tok"
++ {"unsigned", TK_UNSIGNED},
++#line 17 "token2.tok"
++ {"goto", TK_GOTO},
++#line 15 "token2.tok"
++ {"float", TK_FLOAT},
++#line 28 "token2.tok"
+ {"switch", TK_SWITCH},
+ {""},
+- {"__LINE__", TK_LINE},
+- {""}, {""},
+- {"static", TK_STATIC},
+- {"do", TK_DO},
+- {"__FILE__", TK_FILE},
++#line 21 "token2.tok"
++ {"register", TK_REGISTER},
++#line 5 "token2.tok"
+ {"case", TK_CASE},
+- {"const", TK_CONST},
+- {"sizeof", TK_SIZEOF},
++#line 23 "token2.tok"
++ {"short", TK_SHORT},
++#line 24 "token2.tok"
++ {"signed", TK_SIGNED},
+ {""},
++#line 36 "token2.tok"
++ {"__LINE__", TK_LINE},
++#line 13 "token2.tok"
++ {"enum", TK_ENUM},
++#line 7 "token2.tok"
++ {"const", TK_CONST},
++#line 14 "token2.tok"
++ {"extern", TK_EXTERN},
++#line 10 "token2.tok"
++ {"do", TK_DO},
++#line 8 "token2.tok"
+ {"continue", TK_CONTINUE},
+- {"char", TK_CHAR},
+- {"short", TK_SHORT},
+- {"struct", TK_STRUCT},
+- {""}, {""},
++#line 12 "token2.tok"
+ {"else", TK_ELSE},
+- {"union", TK_UNION},
+- {""}, {""},
+- {"unsigned", TK_UNSIGNED},
+- {""},
+- {"break", TK_BREAK},
+- {"signed", TK_SIGNED},
+- {""}, {""}, {""}, {""},
++#line 34 "token2.tok"
++ {"while", TK_WHILE},
++#line 11 "token2.tok"
+ {"double", TK_DOUBLE},
++#line 9 "token2.tok"
+ {"default", TK_DEFAULT},
+- {"for", TK_FOR},
+- {""},
+- {"float", TK_FLOAT},
+- {""}, {""},
+- {"int", TK_INT},
+- {"enum", TK_ENUM},
+- {""}, {""},
+- {"typedef", TK_TYPEDEF},
+- {"register", TK_REGISTER},
++#line 33 "token2.tok"
++ {"volatile", TK_VOLATILE},
++#line 3 "token2.tok"
+ {"auto", TK_AUTO},
+- {""}, {""}, {""}, {""},
++#line 4 "token2.tok"
++ {"break", TK_BREAK},
++#line 25 "token2.tok"
++ {"sizeof", TK_SIZEOF},
++ {""},
++#line 35 "token2.tok"
++ {"__FILE__", TK_FILE},
++#line 20 "token2.tok"
+ {"long", TK_LONG},
+- {""}, {""}, {""},
+- {"volatile", TK_VOLATILE},
+- {""}, {""},
+- {"return", TK_RETURN},
+- {""}, {""}, {""}, {""},
+- {"extern", TK_EXTERN},
++ {""},
++#line 26 "token2.tok"
++ {"static", TK_STATIC},
+ {""}, {""},
+- {"goto", TK_GOTO}
++#line 6 "token2.tok"
++ {"char", TK_CHAR}
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+- register int key = hash2 (str, len);
++ register unsigned int key = hash2 (str, len);
+
+- if (key <= MAX_HASH_VALUE && key >= 0)
++ if (key <= MAX_HASH_VALUE)
+ {
+ register const char *s = wordlist[key].name;
+
+- if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
++ if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
+ return &wordlist[key];
+ }
+ }
diff --git a/recipes-extended/dev86/dev86_git.bb b/recipes-extended/dev86/dev86_git.bb
index c987342..a5f40fa 100644
--- a/recipes-extended/dev86/dev86_git.bb
+++ b/recipes-extended/dev86/dev86_git.bb
@@ -9,6 +9,8 @@ PV = "${BASE_PV}+git${SRCPV}"
SRCREV = "e254e0b19651d3b8a20225b40281c9974a95dec4"
SRC_URI = "git://github.com/jbruchon/${BPN}.git;protocol=https \
file://0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch \
+ file://0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch \
+ file://0004-regen-token2.h-token1.h-with-gperf-3.1.patch \
"
SRC_URI_append_class-target = " \
file://0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch \
--
2.32.0


[hardknott][PATCH 09/13] dev86: depend on dev86-native for ifdefg

Martin Jansa
 

Signed-off-by: Martin Jansa <Martin.Jansa@...>
---
...espect-LDFLAGS-when-building-bcc-cpp.patch | 23 ++++++++++++
...efg-from-dev86-native-instead-of-tar.patch | 36 +++++++++++++++++++
recipes-extended/dev86/dev86_git.bb | 17 ++++++---
3 files changed, 71 insertions(+), 5 deletions(-)
create mode 100644 recipes-extended/dev86/dev86/0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch
create mode 100644 recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch

diff --git a/recipes-extended/dev86/dev86/0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch b/recipes-extended/dev86/dev86/0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch
new file mode 100644
index 0000000..fc7fdd5
--- /dev/null
+++ b/recipes-extended/dev86/dev86/0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch
@@ -0,0 +1,23 @@
+From 12f3a54801e15f3bdd5222ca1487f2fe36141c5d Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@...>
+Date: Fri, 14 May 2021 06:30:18 -0700
+Subject: [PATCH] cpp/Makefile: respect LDFLAGS when building bcc-cpp
+
+Signed-off-by: Martin Jansa <Martin.Jansa@...>
+---
+ cpp/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpp/Makefile b/cpp/Makefile
+index 0ea43cc..303b43c 100644
+--- a/cpp/Makefile
++++ b/cpp/Makefile
+@@ -3,7 +3,7 @@ CFLAGS=-Wall -Wstrict-prototypes
+ all: bcc-cpp
+
+ bcc-cpp: main.o cpp.o hash.o token1.o token2.o
+- $(CC) $(CFLAGS) -o bcc-cpp main.o cpp.o hash.o token1.o token2.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -o bcc-cpp main.o cpp.o hash.o token1.o token2.o
+
+ clean realclean:
+ rm -f bcc-cpp main.o cpp.o hash.o token1.o token2.o tmp.h
diff --git a/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch b/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch
new file mode 100644
index 0000000..52d5d59
--- /dev/null
+++ b/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch
@@ -0,0 +1,36 @@
+From 9b347a5ee9604d4ec972506328ee44a0d8eb1bf0 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@...>
+Date: Fri, 14 May 2021 06:32:02 -0700
+Subject: [PATCH] Makefile: use ifdefg from dev86-native instead of target
+
+* recipe is restricted to:
+ COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
+ so it's less likely to reproduce invalid combination of
+ host and target, but I guess if you have aarch64 build
+ machine and build for x86 then it might fail as for Bruce:
+
+| ./ifdefg -MU makefile.in >tmp.mak
+| /bin/sh: 1: ./ifdefg: not found
+| make[1]: *** [Makefile:46: make.fil] Error 127
+
+ use ifdefg from native build to increase chances that it
+ will be compatible with your host system
+
+Signed-off-by: Martin Jansa <Martin.Jansa@...>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 8a61b65..7fdf861 100644
+--- a/Makefile
++++ b/Makefile
+@@ -43,7 +43,7 @@ realclean:
+ -for X in */; do cd $$X && make clean; cd $(WD); done
+
+ make.fil: $(IFDEFNAME) makefile.in
+- ./$(IFDEFNAME) -MU $(IFDEFOPTS) makefile.in >tmp.mak
++ $(IFDEFNAME) -MU $(IFDEFOPTS) makefile.in >tmp.mak
+ echo > tmp.sed
+ [ "$(BINDIR)" != "//bin" ] || echo >> tmp.sed "s:%BINDIR%:/bin:"
+ [ "$(LIBDIR)" != "//lib/bcc" ] || echo >> tmp.sed "s:%LIBDIR%:/lib/bcc:"
diff --git a/recipes-extended/dev86/dev86_git.bb b/recipes-extended/dev86/dev86_git.bb
index 476bf38..c987342 100644
--- a/recipes-extended/dev86/dev86_git.bb
+++ b/recipes-extended/dev86/dev86_git.bb
@@ -7,21 +7,23 @@ SECTION = "console/tools"
BASE_PV="0.16.21"
PV = "${BASE_PV}+git${SRCPV}"
SRCREV = "e254e0b19651d3b8a20225b40281c9974a95dec4"
-SRC_URI = "git://github.com/jbruchon/${BPN}.git;protocol=https"
+SRC_URI = "git://github.com/jbruchon/${BPN}.git;protocol=https \
+ file://0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch \
+"
+SRC_URI_append_class-target = " \
+ file://0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch \
+"

S = "${WORKDIR}/git"

-DEPENDS = "gperf-native"
+DEPENDS = "gperf-native dev86-native"

BBCLASSEXTEND = "native"
EXTRA_OEMAKE = "VERSION=${BASE_PV} PREFIX=${prefix} DIST=${D} LDFLAGS='${LDFLAGS}'"

do_compile() {
- # ${S}/Makefile does respect LDFLAGS, but ${S}/cpp/Makefile doesn't when building bcc-cpp
- sed -i 's#$(CC) $(CFLAGS) -o bcc-cpp#$(CC) $(CFLAGS) $(LDFLAGS) -o bcc-cpp#g' ${S}/cpp/Makefile
oe_runmake make.fil
oe_runmake -f make.fil bcc86 as86 ld86
-
}

do_install() {
@@ -33,8 +35,13 @@ do_install() {
oe_runmake install-bcc
ln -s ../lib/bcc/bcc-cpp ${D}${prefix}/bin/bcc-cpp
ln -s ../lib/bcc/bcc-cc1 ${D}${prefix}/bin/bcc-cc1
+}

+do_install_append_class-native() {
+ install -v -m 755 ${B}/ifdefg ${D}${bindir}
}
+
COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
FILES_${PN} += "${libdir}/bcc"
+
INSANE_SKIP_${PN} = "already-stripped"
--
2.32.0


[hardknott][PATCH 08/13] dev86: switch to still maintained fork of dev86

Martin Jansa
 

* as mentioned in:
https://github.com/lkundrak/dev86/pull/17
the original lkundrak repo is no longer maintained

* pass only BASE_PV as VERSION in EXTRA_OEMAKE to prevent:
| version.h:4:20: error: ‘gitAUTOINC’ undeclared (first use in this function)
| #define VER_PAT 21+gitAUTOINC+e254e0b196
| ^

* there are many new commits, we need at least that fix for
newer gperf

git log --oneline v0.16.21..jbruchon/master
e254e0b (jbruchon/master) Merge pull request #21 from tkchia/master
3473bde [libc] update _signal syscall semantics, per ABI change in ELKS at https://github.com/jbruchon/elks/pull/629
d74e90d Merge pull request #20 from tkchia/tkchia/update-syscalls
541a8d5 [libc] update syscall list & ino_t type, per ELKS tree
710e852 Merge pull request #16 from spacerace/master
b215454 Merge pull request #17 from mfld-fr/master
870635e Move EMU86 & MON86 to standalone projects
84e3d00 [mon86] Latest touch before moving
c2f288c [emu86] Latest touch before moving
f7449f3 libc tests for MSDOS target (far away from complete ;))
6cbd64d fixing problem in string.h introduced by myself -.-
39e04cd Merge branch 'master' of https://github.com/spacerace/dev86
b44e43d Added OpenBSD's timingsafe_bcmp() and timingsafe_memcmp()
857c30e Added BSD's strlcat() and strlcpy(), safe string copy/cat
0764e09 typo in string.h
2fb6a3a swab()
4e09d08 strupr()
2bd985f strset()
5a7bb33 strrev()
56be26a strnset()
c919b2d strlwr()
b63f295 h+Mf bzero() strnset() strset() strlwr() strupr() strrev() swab()
5985246 removed old implementation of strstr. if anyone needs this file => remains in git history
7b481c0 added bzero()
776929c Merge pull request #15 from spacerace/master
8206ed2 stdlib.h + Makefile changes for getenv() and system()
b995d1e getenv() implementation
60466fe system() implementation
12439ac note on __mkenv (related to getenv commits from me)
aae041a removed empty line on top of file
6d6d91f removed uneeded empty file (see sound.c)
ff7d37e formatting (tabs)
246418a formatting in one line fixed
4ff1f48 Merge pull request #14 from mfld-fr/emu86
1b8f8db Add data & suspicious opcode breakpoints
798c4a2 Merge pull request #13 from rdebath/jbruchon
2eb4d82 Add .travis.yml for running "make distribution" tests.
2ea54e1 Merge pull request #12 from mgorny/makez
f14f78e build: Always use $(MAKE) to spawn sub-make
dfb9b42 Merge pull request #11 from mfld-fr/emu86
6ae2b54 Make dev86 working "in tree"
224843f Merge pull request #10 from mfld-fr/emu86
e56a958 [emu86] Test against ELKS - Round 3
0099ec8 Merge pull request #9 from mfld-fr/emu86
32865c8 [emu86] Test against ELKS - Round 2
e1aa9bd Merge pull request #8 from mfld-fr/emu86
c7ebb2a [emu86] Optimize execution lookup
57019a7 [emu86] Complete decoding optimization
de516a5 [emu86] Fix mfld-fr#21 : opcode 90h (NOP)
40f7c99 [emu86] Optimize decoding < C0h
91d4c61 [emu86] Fix mfld-fr#16 : add pcat timing options
d519caf [emu86] Fix mfld-fr#14 : trace support
3a479e7 [emu86] Check vector before interrupt
7eec401 Optimize decoding < 80h
98334d3 Fix mfld-fr#8 and warning cleanup
0579c82 Merge pull request #7 from mfld-fr/master
49492b9 [emu86] Add option for tiny model
da6a960 [emu86] fix #19 : remove PT1 test
e3b465f [dis88] Move back from ELKS
f2ea895 Merge pull request #6 from mfld-fr/master
b0700f4 [mon86] First stage removal after second validated
6ef705d [mon86] Fix #18 : Complete host tool
1fa5a70 Fix #10 and #11 : Target specific code
22c7770 Merge branch 'bug86'
e25c996 [mon86] Tune host tool for read & write
47aadb5 [mon86] Fix #15 : Cleanup in host tool
ae7c628 [mon86] Makefile for host part + more testing
ae6c84a [mon86] New host tool + fix context parsing
c9205ac Add missing void types to libc/misc/qsort.c
7a4f074 unproto: fix macOS Sierra compilation error reported by scontini76
ac6d924 unproto: better CFLAGS
f86ad57 bcc: if EOF is hit before end of comment, report it as an error
fcdbcd7 limits.h: add PATH_MAX
7239fea include: Add a skeleton for inttypes.h
f3e88f9 Remove accidental ignoring of "include"
0ac417a Merge branch 'master' of https://github.com/jbruchon/dev86
74753fa Fix size_t declaration, add ssize_t declaration
4be53b7 Merge pull request #5 from mfld-fr/master
d5ecd9c [mon86] Second stage tested on real SBC
81b0ab2 [mon86] Second stage monitor completed
b55cbbc [mon86] Trace & break interrupt support
18a5ba8 Merge pull request #4 from mfld-fr/master
77f028b [mon86] First stage monitor completed
07689d4 Merge remote-tracking branch 'upstream/master'
e043007 Revert accidental bcc changes in commit 3c83dee
495b99a [emu86] Test against ELKS - Round 1
5508efa Merge pull request #3 from mfld-fr/master
8aa3313 [emu86] Testing against a real ROM - Round 1
d8ac93e [emu86] Fixed #7 : segment selection & override
5b521d6 [emu86] Test against a real POST - Round 2
3c83dee [emu86] Test against a real POST - Round 1
b45a3d2 [emu86] Command line options
345513c [emu86] Fixed #6 : simplified variable size
2d7d316 [emu86] Fixed #2 + FAR call & ret
8ac48bf Import MON86 standalone project needed by EMU86
1da15c0 Bug fixes after EMU86 testing
1dc5fd3 Merge pull request #2 from mfld-fr/master
24935c0 [emu86] Final touch before the weekend
9090120 [emu86] Fixed #5 : redirect serial I/O to PTS
96dfb1a [emu86] Added memory and stack dumps
4fbcead [emu86] Fixed #1 : move reg num out of val struct
205e47d Improved EMU86 for MON86 testing
377ed40 Merge branch 'master' into emu86
fd3cf7e Added partial ZF and CF flags support
c758426 Merge pull request #1 from mfld-fr/master
72ad336 Merge branch 'master' of git://github.com/jbruchon/dev86 into emu86
2d8398b More support of 8086 instruction set
b2eadba EMU86 second draft
9a8e116 EMU86 first draft
fb3b436 Revert "fix linker alignment for .bss segment"
bf19066 Merge https://github.com/anchorz/dev86-1
4e8476e Revert "copt: fix a minor glitch in copt/rules.86"
1bcc185 Merge remote-tracking branch 'upstream/master'
b0426b2 Force output of initial segment directive
a44b267 fix linker alignment for .bss segment
c0832c8 under CYGWIN bcc requires -o option to compile an .o file otherwise it ends up as .exe and cannot link
80d485b (origin/master, origin/HEAD) Add stdint.h header to recognize some C99 types
29dbfca libc/msdos: program name missing in argv[0]
b0e9b25 libc/msdos: __mkargv es register changed
4a350d3 ar: rename of temporary libary fails on some platforms
cf72284 copt: fix a minor glitch in copt/rules.86
ce888f6 Allow copt rules with empty outputs; fix minor glitch in copt/rules.86
4ed1997 bcc/dbprintf.c: ix implicit declaration warnings
9de6f00 Make a.out.h portable to 64 bit systems
7eae1c0 Change strstr() to Jody's two-way implementation
2f53e83 Add a .gitignore file
c21e14a initial version with minimal routines
fa9c32e Add stdint.h header to recognize some C99 types
6e8432b Minor style cleanups
b7a191c Add "make distclean" and make it really clean everything
dab04fb bootblocks: long -> int32_t for proper building on 64-bit hosts
0d9ee41 bootblocks requires as86_encap to build

Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
recipes-extended/dev86/{dev86_0.16.21.bb => dev86_git.bb} | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
rename recipes-extended/dev86/{dev86_0.16.21.bb => dev86_git.bb} (79%)

diff --git a/recipes-extended/dev86/dev86_0.16.21.bb b/recipes-extended/dev86/dev86_git.bb
similarity index 79%
rename from recipes-extended/dev86/dev86_0.16.21.bb
rename to recipes-extended/dev86/dev86_git.bb
index def7c5c..476bf38 100644
--- a/recipes-extended/dev86/dev86_0.16.21.bb
+++ b/recipes-extended/dev86/dev86_git.bb
@@ -4,15 +4,17 @@ LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
SECTION = "console/tools"

-SRCREV = "c6f36cbafa979710b809f117562773dbd6825918"
-SRC_URI = "git://github.com/lkundrak/${BPN}.git;protocol=https"
+BASE_PV="0.16.21"
+PV = "${BASE_PV}+git${SRCPV}"
+SRCREV = "e254e0b19651d3b8a20225b40281c9974a95dec4"
+SRC_URI = "git://github.com/jbruchon/${BPN}.git;protocol=https"

S = "${WORKDIR}/git"

DEPENDS = "gperf-native"

BBCLASSEXTEND = "native"
-EXTRA_OEMAKE = "VERSION=${PV} PREFIX=${prefix} DIST=${D} LDFLAGS='${LDFLAGS}'"
+EXTRA_OEMAKE = "VERSION=${BASE_PV} PREFIX=${prefix} DIST=${D} LDFLAGS='${LDFLAGS}'"

do_compile() {
# ${S}/Makefile does respect LDFLAGS, but ${S}/cpp/Makefile doesn't when building bcc-cpp
--
2.32.0


[hardknott][PATCH 07/13] dev86: add dependency on gperf-native

Martin Jansa
 

* fails to build on hosts without gperf:
/bin/sh: gperf: command not found
Makefile:27: recipe for target 'token2.h' failed

* normally this isn't triggered, because token[12].h
are included in git repo, but regenerating them fails:
tmp-glibc/work/x86_64-linux/dev86-native/0.16.21-r0/git/cpp$ touch token1.tok
tmp-glibc/work/x86_64-linux/dev86-native/0.16.21-r0/git/cpp$ make bcc-cpp
gperf -aptTc -N is_ctok -H hash1 token1.tok > tmp.h
/bin/sh: gperf: command not found
Makefile:23: recipe for target 'token1.h' failed
make: *** [token1.h] Error 127

* unfortunately this isn't enough, because new gperf 3.1 from oe-core
isn't compatible, we need to upgrade to different dev86 fork which
contains:
https://github.com/jbruchon/dev86/pull/19

Signed-off-by: Martin Jansa <Martin.Jansa@...>
Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
recipes-extended/dev86/dev86_0.16.21.bb | 2 ++
1 file changed, 2 insertions(+)

diff --git a/recipes-extended/dev86/dev86_0.16.21.bb b/recipes-extended/dev86/dev86_0.16.21.bb
index cf64a9d..def7c5c 100644
--- a/recipes-extended/dev86/dev86_0.16.21.bb
+++ b/recipes-extended/dev86/dev86_0.16.21.bb
@@ -9,6 +9,8 @@ SRC_URI = "git://github.com/lkundrak/${BPN}.git;protocol=https"

S = "${WORKDIR}/git"

+DEPENDS = "gperf-native"
+
BBCLASSEXTEND = "native"
EXTRA_OEMAKE = "VERSION=${PV} PREFIX=${prefix} DIST=${D} LDFLAGS='${LDFLAGS}'"

--
2.32.0


[hardknott][PATCH 06/13] xvisor: set PV

Martin Jansa
 

* use something more reasonable than default 'git' from filename
* there wasn't a new tag for a long time, so this is quite far
from 0.3.0 as git describe shows:
v0.3.0-231-g6b23764a
but 0.3.0 is still the closest release I've found
and matches PROJECT_VERSION in Makefile:
https://github.com/avpatel/xvisor-next/blob/6b23764a1439f9d08b2ed2f363da522460d8a22b/Makefile#L29

Signed-off-by: Martin Jansa <Martin.Jansa@...>
---
recipes-extended/xvisor/xvisor_git.bb | 2 ++
1 file changed, 2 insertions(+)

diff --git a/recipes-extended/xvisor/xvisor_git.bb b/recipes-extended/xvisor/xvisor_git.bb
index 85ac163..7510a8b 100644
--- a/recipes-extended/xvisor/xvisor_git.bb
+++ b/recipes-extended/xvisor/xvisor_git.bb
@@ -8,6 +8,8 @@ require xvisor-configs.inc

inherit autotools-brokensep

+PV = "0.3.0+git${SRCPV}"
+
# This version support the RISC-V v0.5.0 Hypervisor extensions
SRCREV = "6b23764a1439f9d08b2ed2f363da522460d8a22b"
SRC_URI = "git://github.com/avpatel/xvisor-next.git;branch=master;protocol=https \
--
2.32.0


[hardknott][PATCH 02/13] uxen-guest-tools: fix build against kernels 5.4+

Martin Jansa
 

From: Bruce Ashfield <bruce.ashfield@...>

This is a compile only fix to update the uxen kernel modules to
work against newer kernels.

Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
...m-support-fix-build-for-kernel-s-5.4.patch | 97 +++++++++++++++++++
.../uxen/uxen-guest-tools_4.1.8.bb | 1 +
2 files changed, 98 insertions(+)
create mode 100644 recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch

diff --git a/recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch b/recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch
new file mode 100644
index 0000000..a3325ce
--- /dev/null
+++ b/recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch
@@ -0,0 +1,97 @@
+From 21bb6953a64390dd1c5a8b7520eb5e2c18ea3ff1 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@...>
+Date: Mon, 29 Nov 2021 21:01:03 -0500
+Subject: [PATCH] vm-support: fix build for kernel's > 5.4
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
+---
+ a/uxenhc/hypercall.c | 10 +++++++++-
+ a/v4vvsock/v4v_vsock.c | 2 ++
+ a/vmdiagnostics/vm_diagnostics.c | 9 ++++++++-
+ 3 files changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/uxenhc/hypercall.c b/uxenhc/hypercall.c
+index 0b9ef3f..04957a8 100644
+--- a/uxenhc/hypercall.c
++++ b/uxenhc/hypercall.c
+@@ -10,6 +10,7 @@
+ #include <linux/mm.h>
+ #include <linux/spinlock.h>
+ #include <linux/compiler.h>
++#include <linux/version.h>
+
+ #include <xen/xen.h>
+ #include <xen/version.h>
+@@ -124,7 +125,11 @@ static int __init uxen_hypercall_init(void)
+ printk(KERN_INFO "using uxen hypervisor\n");
+
+ if (!uxen_hcbase) {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0))
+ uxen_hcbase = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);
++#else
++ uxen_hcbase = __vmalloc(PAGE_SIZE, GFP_KERNEL);
++#endif
+ if (!uxen_hcbase) {
+ ret = -ENOMEM;
+ goto out;
+@@ -149,8 +154,11 @@ static void __exit uxen_hypercall_exit(void)
+ {
+ }
+
++
++#define KBUILD_MODFILE "uxenhc"
++
+ module_init(uxen_hypercall_init);
+ module_exit(uxen_hypercall_exit);
++MODULE_LICENSE("GPL");
+ MODULE_AUTHOR("paulian.marinca@...");
+ MODULE_DESCRIPTION("uXen hypercall support");
+-MODULE_LICENSE("GPL");
+diff --git a/v4vvsock/v4v_vsock.c b/v4vvsock/v4v_vsock.c
+index 8d80d7d..cd7e8ce 100644
+--- a/v4vvsock/v4v_vsock.c
++++ b/v4vvsock/v4v_vsock.c
+@@ -578,8 +578,10 @@ static const struct proto_ops vsock_dgram_ops = {
+ .ioctl = sock_no_ioctl,
+ .listen = sock_no_listen,
+ .shutdown = sock_no_shutdown,
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
+ .setsockopt = sock_no_setsockopt,
+ .getsockopt = sock_no_getsockopt,
++#endif
+ .sendmsg = vsock_sendmsg,
+ .recvmsg = vsock_recvmsg,
+ .mmap = sock_no_mmap,
+diff --git a/vmdiagnostics/vm_diagnostics.c b/vmdiagnostics/vm_diagnostics.c
+index 9ff94fb..db14e57 100644
+--- a/vmdiagnostics/vm_diagnostics.c
++++ b/vmdiagnostics/vm_diagnostics.c
+@@ -22,6 +22,7 @@
+ #include <linux/timekeeping.h>
+ #include <linux/types.h>
+ #include <linux/vmstat.h>
++#include <linux/version.h>
+
+ #include <uxen-v4vlib.h>
+
+@@ -403,10 +404,16 @@ static void vm_handle_request_stat_task(struct vm_diagnostics_context *context,
+
+ task_payload.state = task_state_to_char(task);
+ task_payload.num_threads = get_nr_threads(task);
++
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0))
+ task_payload.start_time_nsec = task->real_start_time;
++#else
++ task_payload.start_time_nsec = task->start_boottime;
++#endif
++
+ task_payload.last_run_cpu_id = task_cpu(task);
+
+- thread_group_cputime_adjusted(task, &user_nsec, &system_nsec);
++ //thread_group_cputime_adjusted(task, &user_nsec, &system_nsec);
+ task_payload.user_nsec = user_nsec;
+ task_payload.system_nsec = system_nsec;
+
+--
+2.19.1
+
diff --git a/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
index 2ca0cb1..06dc376 100644
--- a/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
+++ b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
@@ -9,6 +9,7 @@ SRC_URI = " \
https://www.bromium.com/wp-content/uploads/2019/11/uxen-${PV}.zip;name=uxen \
https://www.bromium.com/wp-content/uploads/2019/11/Bromium-4.1.8-Open-Source-Software.pdf;name=license \
file://fix-Makefile-for-OE-kernel-build.patch \
+ file://0001-vm-support-fix-build-for-kernel-s-5.4.patch \
"

SRC_URI[uxen.sha384sum] = "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5ce996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4"
--
2.32.0


[hardknott][PATCH 05/13] xvisor: uprev to latest master and fix python reference

Martin Jansa
 

From: Bruce Ashfield <bruce.ashfield@...>

Bumping to the latest xvisor tip.

We drop one patch that is now part of the upstream, and we
add another to remove /usr/bin/python from scripts called
during build, since it breaks the build on hosts without
/usr/bin/python.

Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
...-Allow-Xvisor-to-compile-with-gcc-10.patch | 55 -------------------
...d-use-usr-bin-env-for-python-scripts.patch | 36 ++++++++++++
recipes-extended/xvisor/xvisor_git.bb | 6 +-
3 files changed, 39 insertions(+), 58 deletions(-)
delete mode 100644 recipes-extended/xvisor/files/0001-EMULATORS-Allow-Xvisor-to-compile-with-gcc-10.patch
create mode 100644 recipes-extended/xvisor/files/0001-build-use-usr-bin-env-for-python-scripts.patch

diff --git a/recipes-extended/xvisor/files/0001-EMULATORS-Allow-Xvisor-to-compile-with-gcc-10.patch b/recipes-extended/xvisor/files/0001-EMULATORS-Allow-Xvisor-to-compile-with-gcc-10.patch
deleted file mode 100644
index 221a314..0000000
--- a/recipes-extended/xvisor/files/0001-EMULATORS-Allow-Xvisor-to-compile-with-gcc-10.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 417184cc41cfd33ae7b4c11c8396e0f47f43e2ba Mon Sep 17 00:00:00 2001
-From: Jean-Christophe Dubois <jcd@...>
-Date: Fri, 8 May 2020 15:17:36 +0200
-Subject: [PATCH] EMULATORS: Allow Xvisor to compile with gcc 10.
-
-With gcc 10 because some header files do not declare some variable
-definition as extern, the variable get duplicated in all files
-using it.
-
-This patch allow xvisor to compile with the latest gcc.
-
-Signed-off-by: Jean-Christophe Dubois <jcd@...>
-Reviewed-by: Anup Patel <anup@...>
----
- drivers/mmc/core/core.h | 2 +-
- emulators/display/drawfn.h | 10 +++++-----
- 2 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
-index d75d135a..e2ca3141 100644
---- a/drivers/mmc/core/core.h
-+++ b/drivers/mmc/core/core.h
-@@ -64,7 +64,7 @@ int mmc_go_idle(struct mmc_host *host);
- * Note: Must be called with host->lock held.
- */
- extern struct vmm_bus sdio_bus_type;
--struct vmm_device_type sdio_func_type;
-+extern struct vmm_device_type sdio_func_type;
-
- int __sdio_attach(struct mmc_host *host);
-
-diff --git a/emulators/display/drawfn.h b/emulators/display/drawfn.h
-index f9163cff..385deaf6 100644
---- a/emulators/display/drawfn.h
-+++ b/emulators/display/drawfn.h
-@@ -69,14 +69,14 @@ typedef void (*drawfn)(struct vmm_surface *,
- DRAWFN_ORDER_MAX * \
- DRAWFN_FORMAT_MAX)
-
--drawfn drawfn_surface_fntable_8[DRAWFN_FNTABLE_SIZE];
-+extern drawfn drawfn_surface_fntable_8[DRAWFN_FNTABLE_SIZE];
-
--drawfn drawfn_surface_fntable_15[DRAWFN_FNTABLE_SIZE];
-+extern drawfn drawfn_surface_fntable_15[DRAWFN_FNTABLE_SIZE];
-
--drawfn drawfn_surface_fntable_16[DRAWFN_FNTABLE_SIZE];
-+extern drawfn drawfn_surface_fntable_16[DRAWFN_FNTABLE_SIZE];
-
--drawfn drawfn_surface_fntable_24[DRAWFN_FNTABLE_SIZE];
-+extern drawfn drawfn_surface_fntable_24[DRAWFN_FNTABLE_SIZE];
-
--drawfn drawfn_surface_fntable_32[DRAWFN_FNTABLE_SIZE];
-+extern drawfn drawfn_surface_fntable_32[DRAWFN_FNTABLE_SIZE];
-
- #endif
diff --git a/recipes-extended/xvisor/files/0001-build-use-usr-bin-env-for-python-scripts.patch b/recipes-extended/xvisor/files/0001-build-use-usr-bin-env-for-python-scripts.patch
new file mode 100644
index 0000000..dfbb00b
--- /dev/null
+++ b/recipes-extended/xvisor/files/0001-build-use-usr-bin-env-for-python-scripts.patch
@@ -0,0 +1,36 @@
+From eb351ca63a86f53cfb18987284a1445d543dfe56 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@...>
+Date: Mon, 29 Nov 2021 17:20:00 -0500
+Subject: [PATCH] build: use /usr/bin/env for python scripts
+
+Without this, we break on hosts without /usr/bin/python
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
+---
+ tools/scripts/d2c.py | 2 +-
+ tools/scripts/memimg.py | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/scripts/d2c.py b/tools/scripts/d2c.py
+index b46a7bc4..0a6bce08 100755
+--- a/tools/scripts/d2c.py
++++ b/tools/scripts/d2c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python3
+ #/**
+ # Copyright (c) 2013 Anup Patel.
+ # All rights reserved.
+diff --git a/tools/scripts/memimg.py b/tools/scripts/memimg.py
+index 423c9c33..ba2f06cb 100755
+--- a/tools/scripts/memimg.py
++++ b/tools/scripts/memimg.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python3
+ #/**
+ # Copyright (c) 2011 Anup Patel.
+ # All rights reserved.
+--
+2.19.1
+
diff --git a/recipes-extended/xvisor/xvisor_git.bb b/recipes-extended/xvisor/xvisor_git.bb
index 831c943..85ac163 100644
--- a/recipes-extended/xvisor/xvisor_git.bb
+++ b/recipes-extended/xvisor/xvisor_git.bb
@@ -9,10 +9,10 @@ require xvisor-configs.inc
inherit autotools-brokensep

# This version support the RISC-V v0.5.0 Hypervisor extensions
-SRCREV = "b3dac5b1f61f23f21dc59b3880897cff78f3b618"
-SRC_URI = "git://github.com/avpatel/xvisor-next.git \
+SRCREV = "6b23764a1439f9d08b2ed2f363da522460d8a22b"
+SRC_URI = "git://github.com/avpatel/xvisor-next.git;branch=master;protocol=https \
file://0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch \
- file://0001-EMULATORS-Allow-Xvisor-to-compile-with-gcc-10.patch \
+ file://0001-build-use-usr-bin-env-for-python-scripts.patch \
"

S = "${WORKDIR}/git"
--
2.32.0

561 - 580 of 7515