[PATCH v2025.09.y 58/58] scripts: fix build failure with glibc 2.43

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Mar 13 06:25:42 PDT 2026


From: Hemanth Kumar M D <Hemanth.KumarMD at windriver.com>

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.

Signed-off-by: Hemanth Kumar M D <Hemanth.KumarMD at windriver.com>
Link: https://git.openembedded.org/openembedded-core/commit/meta/recipes-bsp/barebox?id=a217683514e051f996fe5675cf9accd44692f6ab
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
Link: https://lore.kernel.org/barebox/177340033069.206252.6842304138227246713.b4-ty@pengutronix.de
---
 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 5b0133345bb9..33cea1986df5 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
-- 
2.47.3




More information about the barebox mailing list