diff mbox series

[v3,5/6] barebox-tools: fix build failure with glibc 2.43

Message ID 20260310174403.2309825-5-Hemanth.KumarMD@windriver.com
State Accepted, archived
Commit a217683514e051f996fe5675cf9accd44692f6ab
Headers show
Series [v3,1/6] glibc: Upgrade to 2.43 release | expand

Commit Message

Hemanth Kumar M D March 10, 2026, 5:44 p.m. UTC
From: Hemanth Kumar M D <Hemanth.KumarMD@windriver.com>

glibc 2.43 introduces linux/openat2.h through the fcntl include chain
(bits/fcntl-linux.h -> linux/openat2.h) which expects __u64 to be
defined before inclusion. Move <fcntl.h> in barebox scripts/include/
linux/types.h to after the typedef definitions to fix the build.

Signed-off-by: Hemanth Kumar M D <Hemanth.KumarMD@windriver.com>
---
 meta/recipes-bsp/barebox/barebox-tools.bb     |  2 +
 ...x-tools-fix-glibc-2.43-openat2-build.patch | 43 +++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 meta/recipes-bsp/barebox/files/0001-barebox-tools-fix-glibc-2.43-openat2-build.patch

Comments

Alexander Kanavin March 10, 2026, 6:06 p.m. UTC | #1
On Tue, 10 Mar 2026 at 18:45, Hemanth Kumar M D via
lists.openembedded.org
<Hemanth.KumarMD=windriver.com@lists.openembedded.org> wrote:
> +barebox-tools: fix build failure with glibc 2.43
> +
> +glibc 2.43 introduces linux/openat2.h through the fcntl include chain
> +(bits/fcntl-linux.h -> linux/openat2.h). This header expects the
> +__u64 type to be defined before inclusion.
> +
> +In barebox scripts/include/linux/types.h the header <fcntl.h> was
> +included before the __u64 typedef, causing build failures such as:
> +
> +  linux/openat2.h:20:9: error: unknown type name '__u64'
> +
> +Move the inclusion of <fcntl.h> after the typedef definitions so that
> +__u64 and related types are defined before linux/openat2.h is parsed.
> +
> +Upstream-Status: Pending

This should be submitted upstream, we should try to avoid adding
Pending patches without a clear reason given.

Alex
Randy MacLeod March 12, 2026, 7:07 p.m. UTC | #2
On 2026-03-10 2:06 p.m., Alexander Kanavin wrote:
> On Tue, 10 Mar 2026 at 18:45, Hemanth Kumar M D via
> lists.openembedded.org
> <Hemanth.KumarMD=windriver.com@lists.openembedded.org> wrote:
>> +barebox-tools: fix build failure with glibc 2.43
>> +
>> +glibc 2.43 introduces linux/openat2.h through the fcntl include chain
>> +(bits/fcntl-linux.h -> linux/openat2.h). This header expects the
>> +__u64 type to be defined before inclusion.
>> +
>> +In barebox scripts/include/linux/types.h the header <fcntl.h> was
>> +included before the __u64 typedef, causing build failures such as:
>> +
>> +  linux/openat2.h:20:9: error: unknown type name '__u64'
>> +
>> +Move the inclusion of <fcntl.h> after the typedef definitions so that
>> +__u64 and related types are defined before linux/openat2.h is parsed.
>> +
>> +Upstream-Status: Pending
> This should be submitted upstream, we should try to avoid adding
> Pending patches without a clear reason given.
>
> Alex

Hemanth meant to reply saying:

Hi Alex,

Sure, I'll do that but since we're in a hurry to get the glibc-2.43 merged,
I'll keep the existing status and follow-up with a status change next week,
once I've had time to submit a patch to upstream barebox:
https://github.com/barebox/barebox?tab=readme-ov-file#contributing

Right Hemanth ?   :-)
Alexander Kanavin March 12, 2026, 7:17 p.m. UTC | #3
On Thu, 12 Mar 2026 at 20:07, Randy MacLeod <randy.macleod@windriver.com> wrote:

> Hemanth meant to reply saying:
>
> Hi Alex,
>
> Sure, I'll do that but since we're in a hurry to get the glibc-2.43 merged,
> I'll keep the existing status and follow-up with a status change next week,
> once I've had time to submit a patch to upstream barebox:
>   https://github.com/barebox/barebox?tab=readme-ov-file#contributing
>
> Right Hemanth ?   :-)

No problem :) Note that v4 also does not address a Pending patch in
ltp. I made a comment to v3.

Alex
diff mbox series

Patch

diff --git a/meta/recipes-bsp/barebox/barebox-tools.bb b/meta/recipes-bsp/barebox/barebox-tools.bb
index eb327306d9..1459f48db2 100644
--- a/meta/recipes-bsp/barebox/barebox-tools.bb
+++ b/meta/recipes-bsp/barebox/barebox-tools.bb
@@ -2,6 +2,8 @@  SUMMARY = "barebox bootloader tools"
 
 require barebox-common.inc
 
+SRC_URI += "file://0001-barebox-tools-fix-glibc-2.43-openat2-build.patch"
+
 LICENSE = "GPL-2.0-only"
 
 DEPENDS = "bison-native flex-native libusb1"
diff --git a/meta/recipes-bsp/barebox/files/0001-barebox-tools-fix-glibc-2.43-openat2-build.patch b/meta/recipes-bsp/barebox/files/0001-barebox-tools-fix-glibc-2.43-openat2-build.patch
new file mode 100644
index 0000000000..2ff7cb82a6
--- /dev/null
+++ b/meta/recipes-bsp/barebox/files/0001-barebox-tools-fix-glibc-2.43-openat2-build.patch
@@ -0,0 +1,43 @@ 
+barebox-tools: fix build failure with glibc 2.43
+
+glibc 2.43 introduces linux/openat2.h through the fcntl include chain
+(bits/fcntl-linux.h -> linux/openat2.h). This header expects the
+__u64 type to be defined before inclusion.
+
+In barebox scripts/include/linux/types.h the header <fcntl.h> was
+included before the __u64 typedef, causing build failures such as:
+
+  linux/openat2.h:20:9: error: unknown type name '__u64'
+
+Move the inclusion of <fcntl.h> after the typedef definitions so that
+__u64 and related types are defined before linux/openat2.h is parsed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hemanth Kumar M D <Hemanth.KumarMD@windriver.com>
+---
+
+ scripts/include/linux/types.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/scripts/include/linux/types.h b/scripts/include/linux/types.h
+index 5b01333..33cea19 100644
+--- a/scripts/include/linux/types.h
++++ b/scripts/include/linux/types.h
+@@ -4,7 +4,6 @@
+ #include <stdbool.h>
+ #include <stddef.h>
+ #include <stdint.h>
+-#include <fcntl.h>
+
+ typedef uint64_t __u64;
+ typedef int64_t __s64;
+@@ -15,6 +14,8 @@ typedef int16_t __s16;
+ typedef uint8_t __u8;
+ typedef int8_t __s8;
+
++#include <fcntl.h>
++
+ #ifndef __linux__
+ typedef long long loff_t;
+ #endif