diff mbox series

[meta-oe] toybox: Fix build with glibc 2.36+

Message ID 20220814171126.2994955-1-raj.khem@gmail.com
State Accepted, archived
Headers show
Series [meta-oe] toybox: Fix build with glibc 2.36+ | expand

Commit Message

Khem Raj Aug. 14, 2022, 5:11 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...oid-glibc-and-linux-mount.h-conflict.patch | 32 +++++++++++++++++++
 .../{toybox_0.8.7.bb => toybox_0.8.8.bb}      |  3 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-core/toybox/toybox/0001-portability-Avoid-glibc-and-linux-mount.h-conflict.patch
 rename meta-oe/recipes-core/toybox/{toybox_0.8.7.bb => toybox_0.8.8.bb} (95%)
diff mbox series

Patch

diff --git a/meta-oe/recipes-core/toybox/toybox/0001-portability-Avoid-glibc-and-linux-mount.h-conflict.patch b/meta-oe/recipes-core/toybox/toybox/0001-portability-Avoid-glibc-and-linux-mount.h-conflict.patch
new file mode 100644
index 0000000000..3e63bdd650
--- /dev/null
+++ b/meta-oe/recipes-core/toybox/toybox/0001-portability-Avoid-glibc-and-linux-mount.h-conflict.patch
@@ -0,0 +1,32 @@ 
+From 89000d9cb226cd864fa247f2428c9eaf7f414882 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 14 Aug 2022 10:02:15 -0700
+Subject: [PATCH] portability: Avoid glibc and linux mount.h conflict
+
+With glibc 2.36+ linux/mount.h> and <sys/mount.h> headers are
+no longer directly compatible
+
+Upstream-Status: Submitted [https://github.com/landley/toybox/pull/364]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/portability.h | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lib/portability.h b/lib/portability.h
+index 4de547a..24481ab 100644
+--- a/lib/portability.h
++++ b/lib/portability.h
+@@ -179,8 +179,12 @@ void *memmem(const void *haystack, size_t haystack_length,
+ #define SWAP_LE64(x) (x)
+ #endif
+ 
+-// Linux headers not listed by POSIX or LSB
++// Glibc 2.36 sys/mount.h conflicts with linux/mount.h
++// See https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
++#ifndef _LINUX_MOUNT_H
+ #include <sys/mount.h>
++#endif
++// Linux headers not listed by POSIX or LSB
+ #ifdef __linux__
+ #include <sys/statfs.h>
+ #include <sys/swap.h>
diff --git a/meta-oe/recipes-core/toybox/toybox_0.8.7.bb b/meta-oe/recipes-core/toybox/toybox_0.8.8.bb
similarity index 95%
rename from meta-oe/recipes-core/toybox/toybox_0.8.7.bb
rename to meta-oe/recipes-core/toybox/toybox_0.8.8.bb
index 3441568005..e27f9ed95f 100644
--- a/meta-oe/recipes-core/toybox/toybox_0.8.7.bb
+++ b/meta-oe/recipes-core/toybox/toybox_0.8.8.bb
@@ -8,8 +8,9 @@  LIC_FILES_CHKSUM = "file://LICENSE;md5=78659a599b9325da368f2f1eb88f19c7"
 inherit cml1 update-alternatives
 
 SRC_URI = "http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.gz \
+           file://0001-portability-Avoid-glibc-and-linux-mount.h-conflict.patch \
            "
-SRC_URI[sha256sum] = "b508bf336f82cb0739b77111f945931d1a143b5a53905cb753cd2607cfdd1494"
+SRC_URI[sha256sum] = "dafd41978d40f02a61cf1be99a2b4a25812bbfb9c3157e679ee7611202d6ac58"
 
 SECTION = "base"