diff mbox series

[meta-initramfs] klibc: Fix build with kernel 5.19 headers

Message ID 20220819070348.1490913-1-raj.khem@gmail.com
State Accepted, archived
Headers show
Series [meta-initramfs] klibc: Fix build with kernel 5.19 headers | expand

Commit Message

Khem Raj Aug. 19, 2022, 7:03 a.m. UTC
Backport relevant patch.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...failure-for-some-architectures-with-.patch | 34 +++++++++++++++++++
 .../recipes-devtools/klibc/klibc.inc          |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta-initramfs/recipes-devtools/klibc/files/0001-fcntl-Fix-build-failure-for-some-architectures-with-.patch
diff mbox series

Patch

diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-fcntl-Fix-build-failure-for-some-architectures-with-.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-fcntl-Fix-build-failure-for-some-architectures-with-.patch
new file mode 100644
index 0000000000..4fc4b45fb1
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/klibc/files/0001-fcntl-Fix-build-failure-for-some-architectures-with-.patch
@@ -0,0 +1,34 @@ 
+From a33c262f828f803fffdad8e1f44d524dc9c75856 Mon Sep 17 00:00:00 2001
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Wed, 3 Aug 2022 01:10:01 +0200
+Subject: [PATCH] fcntl: Fix build failure for some architectures with Linux
+ 5.19
+
+Starting from Linux 5.19, the kernel UAPI headers now only define
+__ARCH_FLOCK64_PAD if the architecture actually needs padding in
+struct flock64.  Wrap its use with #ifdef,
+
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=bb2fde5ddbc18a2e7795ca4d24759230c2aae9d0]
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usr/include/fcntl.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/usr/include/fcntl.h b/usr/include/fcntl.h
+index ed703a6..cb2e4e5 100644
+--- a/usr/include/fcntl.h
++++ b/usr/include/fcntl.h
+@@ -33,7 +33,9 @@ struct flock {
+ 	__kernel_loff_t l_start;
+ 	__kernel_loff_t l_len;
+ 	__kernel_pid_t  l_pid;
++#ifdef __ARCH_FLOCK64_PAD
+         __ARCH_FLOCK64_PAD
++#endif
+ };
+ 
+ #ifdef F_GETLK64
+-- 
+2.37.2
+
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc
index 4c915af2fa..5acf679983 100644
--- a/meta-initramfs/recipes-devtools/klibc/klibc.inc
+++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc
@@ -20,6 +20,7 @@  SRC_URI = "${KERNELORG_MIRROR}/linux/libs/klibc/2.0/klibc-${PV}.tar.xz \
            file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \
            file://cross-clang.patch \
            file://0001-workaround-for-overlapping-sections-in-binary.patch \
+           file://0001-fcntl-Fix-build-failure-for-some-architectures-with-.patch \
            "
 
 ARMPATCHES ?= ""