Skip to contentSkip to conversation

Make linux-libc-headers.inc compatible with 4.14

PATCH In review Thomas Viehweger 2 participants 4 messages Jun 5, 2022 – Jun 6, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 Make linux-libc-headers.inc compatible with 4.14

After creating a .bbappend file which sets Linux-4.14 as source

I got the following error:

ERROR: linux-libc-headers-4.14-r0 do_install: oe_multilib_header:
 Unable to find header asm/bpf_perf_event.h.

This is because 4.15 is the first version which includes this header.

Here is a patch wich makes it possible to use versions 4.0..4.14. Versions below 4.0 are still broken for the arm architectures.

---
 .../linux-libc-headers/linux-libc-headers.inc        | 12 ++++++++----

 1 file changed, 8 insertions(+), 4 deletions(-)
meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc +0 -0
index 47f09952de..41ee034dd9 100644
@@ -89,15 +89,19 @@ do_install:append:armeb () {
 

 do_install_armmultilib () {
        if [ ${MAJ_VER} -gt 5 ]; then
-               ARM_KVM_HEADER=""
+               ARM_EXTRA_HEADER="asm/bpf_perf_event.h"
        else
                if [ ${MAJ_VER} -eq 5 ] && [ ${MIN_VER} -ge 8 ]; then
-                       ARM_KVM_HEADER=""
+                       ARM_EXTRA_HEADER="asm/bpf_perf_event.h"
                else
-                       ARM_KVM_HEADER="asm/kvm.h"
+                       if [ ${MAJ_VER} -eq 4 ] && [ ${MIN_VER} -ge 15 ]; then
+                               ARM_EXTRA_HEADER="asm/kvm.h asm/bpf_perf_event.h"
+                       else
+                               ARM_EXTRA_HEADER="asm/kvm.h"
+                       fi
                fi
        fi
-       oe_multilib_header asm/auxvec.h asm/bitsperlong.h asm/byteorder.h asm/fcntl.h asm/hwcap.h asm/ioctls.h $ARM_KVM_HEADER asm/kvm_para.h asm/mman.h asm/param.h asm/perf_regs.h asm/bpf_perf_event.h +       oe_multilib_header asm/auxvec.h asm/bitsperlong.h asm/byteorder.h asm/fcntl.h asm/hwcap.h asm/ioctls.h $ARM_EXTRA_HEADER asm/kvm_para.h asm/mman.h asm/param.h asm/perf_regs.h oe_multilib_header asm/posix_types.h asm/ptrace.h asm/setup.h  asm/sigcontext.h asm/siginfo.h asm/signal.h asm/stat.h  asm/statfs.h asm/swab.h  asm/types.h asm/unistd.h }

Signature · 1 line
2.35.1
#2 lore raw
Quoted 7 lines · Thomas Viehweger

After creating a .bbappend file which sets Linux-4.14 as source

I got the following error:

ERROR: linux-libc-headers-4.14-r0 do_install: oe_multilib_header:
 Unable to find header asm/bpf_perf_event.h.

Quoted 6 lines

This is because 4.15 is the first version which includes this header.

Here is a patch wich makes it possible to use versions 4.0..4.14. Versions below 4.0 are still broken for the arm architectures.

Patches for OE-Core need to go to the openembedded-core mailing list. That said, I'm not accepting this patch.

You should be able to use the most recent linux-libc-headers even with an older kernel. I don't understand this desire people have to use lots of different versions of it but we're not doing it. We do not want a different userspace per kernel.

There is a warning in the recipe about it and I'm not taking patches like this unless someone explains a really good reason why the userspace needs to be built with an older set of headers.

Cheers,

Richard

#3 lore raw
Quoted 9 lines

You should be able to use the most recent linux-libc-headers even with an older kernel. I don't understand this desire people have to use lots of different versions of it but we're not doing it. We do not want a different userspace per kernel.

There is a warning in the recipe about it and I'm not taking patches like this unless someone explains a really good reason why the userspace needs to be built with an older set of headers.

Yes, I have seen the warnings in the receipt. I know that newer kernels shall
be compatible with older userspace. E.g. pyro-userspace should work with kirkstone kernels.
But are you really sure that kirkstone userspace (e.g. glibc compiled with 5.16 kernel headers) does not try to use features which the older kernel does not provide?
So, to ask the other way: what is the reason why kirkstone uses the newer kernel-headers?
Shouldn't the userspace be compiled with the headers of the minimum supported kernel headers instead (for example the oldest supported longterm - currently 4.9)?

Greetings, Thomas

#4 lore raw
Quoted 9 lines · Thomas Viehweger
Quoted 8 lines

You should be able to use the most recent linux-libc-headers even with an older kernel. I don't understand this desire people have to use lots of different versions of it but we're not doing it. We do not want a different userspace per kernel.

There is a warning in the recipe about it and I'm not taking patches like this unless someone explains a really good reason why the userspace needs to be built with an older set of headers.

Quoted 12 lines

Yes, I have seen the warnings in the receipt. I know that newer kernels shall
be compatible with older userspace. E.g. pyro-userspace should work with kirkstone kernels.
But are you really sure that kirkstone userspace (e.g. glibc compiled with 5.16 kernel headers) does not try to use features which the older kernel does not provide?
So, to ask the other way: what is the reason why kirkstone uses the newer kernel-headers?
Shouldn't the userspace be compiled with the headers of the minimum supported kernel headers instead (for example the oldest supported longterm - currently 4.9)?

That isn't how glibc works. There is code in glibc which only uses features if they are available and it defines a kernel version it is compatible back to (see OLDEST_KERNEL) which is architecture specific. Obviously you won't get features in new kernels but it is meant to be safe.

Cheers,

Richard