summaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch')
-rw-r--r--meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch99
1 files changed, 99 insertions, 0 deletions
diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch
new file mode 100644
index 0000000000..82d02f9fb3
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch
@@ -0,0 +1,99 @@
1From 84bfb7a85900446e3cc96a103601052781627043 Mon Sep 17 00:00:00 2001
2From: Florent Revest <revest@chromium.org>
3Date: Mon, 14 Jul 2025 19:25:04 +0200
4Subject: [PATCH 1/2] stdint.h: Fix build with newer clang
5
6Recent versions of Clang introduced definitions for __*INT64_C:
7https://github.com/llvm/llvm-project/commit/33ad474c45e6d7a0de7bc75e15e27cf6cb9ff895
8
9This results in these build errors:
10
11usr/include/bits64/bitsize/stdint.h:27:9: error: '__INT64_C' macro redefined [-Werror,-Wmacro-redefined]
12 27 | #define __INT64_C(c) c ## L
13 | ^
14<built-in>:194:9: note: previous definition is here
15 194 | #define __INT64_C(c) c##L
16 | ^
17
18Renaming these macros to something more unique avoids the errors.
19
20Upstream-Status: Backport [https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=1d27e1732f1326eaf98f4624100f83232d843616]
21Signed-off-by: Florent Revest <revest@chromium.org>
22Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
23Signed-off-by: Khem Raj <raj.khem@gmail.com>
24---
25 usr/include/bits32/bitsize/stdint.h | 4 ++--
26 usr/include/bits64/bitsize/stdint.h | 4 ++--
27 usr/include/stdint.h | 10 +++++-----
28 3 files changed, 9 insertions(+), 9 deletions(-)
29
30diff --git a/usr/include/bits32/bitsize/stdint.h b/usr/include/bits32/bitsize/stdint.h
31index 8e444b6..147090b 100644
32--- a/usr/include/bits32/bitsize/stdint.h
33+++ b/usr/include/bits32/bitsize/stdint.h
34@@ -24,8 +24,8 @@ typedef unsigned int uint_fast32_t;
35 typedef int intptr_t;
36 typedef unsigned int uintptr_t;
37
38-#define __INT64_C(c) c ## LL
39-#define __UINT64_C(c) c ## ULL
40+#define __KLIBC_INT64_C(c) c ## LL
41+#define __KLIBC_UINT64_C(c) c ## ULL
42
43 #define __PRI64_RANK "ll"
44 #define __PRIFAST_RANK ""
45diff --git a/usr/include/bits64/bitsize/stdint.h b/usr/include/bits64/bitsize/stdint.h
46index 988e639..5bc64bf 100644
47--- a/usr/include/bits64/bitsize/stdint.h
48+++ b/usr/include/bits64/bitsize/stdint.h
49@@ -24,8 +24,8 @@ typedef unsigned long int uint_fast32_t;
50 typedef long int intptr_t;
51 typedef unsigned long int uintptr_t;
52
53-#define __INT64_C(c) c ## L
54-#define __UINT64_C(c) c ## UL
55+#define __KLIBC_INT64_C(c) c ## L
56+#define __KLIBC_UINT64_C(c) c ## UL
57
58 #define __PRI64_RANK "l"
59 #define __PRIFAST_RANK "l"
60diff --git a/usr/include/stdint.h b/usr/include/stdint.h
61index f64f027..6cda583 100644
62--- a/usr/include/stdint.h
63+++ b/usr/include/stdint.h
64@@ -31,17 +31,17 @@ typedef uint64_t uintmax_t;
65 #define INT8_MIN (-128)
66 #define INT16_MIN (-32768)
67 #define INT32_MIN (-2147483647-1)
68-#define INT64_MIN (__INT64_C(-9223372036854775807)-1)
69+#define INT64_MIN (__KLIBC_INT64_C(-9223372036854775807)-1)
70
71 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
73 #define INT32_MAX (2147483647)
74-#define INT64_MAX (__INT64_C(9223372036854775807))
75+#define INT64_MAX (__KLIBC_INT64_C(9223372036854775807))
76
77 #define UINT8_MAX (255U)
78 #define UINT16_MAX (65535U)
79 #define UINT32_MAX (4294967295U)
80-#define UINT64_MAX (__UINT64_C(18446744073709551615))
81+#define UINT64_MAX (__KLIBC_UINT64_C(18446744073709551615))
82
83 #define INT_LEAST8_MIN INT8_MIN
84 #define INT_LEAST16_MIN INT16_MIN
85@@ -80,12 +80,12 @@ typedef uint64_t uintmax_t;
86 #define INT8_C(c) c
87 #define INT16_C(c) c
88 #define INT32_C(c) c
89-#define INT64_C(c) __INT64_C(c)
90+#define INT64_C(c) __KLIBC_INT64_C(c)
91
92 #define UINT8_C(c) c ## U
93 #define UINT16_C(c) c ## U
94 #define UINT32_C(c) c ## U
95-#define UINT64_C(c) __UINT64_C(c)
96+#define UINT64_C(c) __KLIBC_UINT64_C(c)
97
98 #define INT_LEAST8_C(c) INT8_C(c)
99 #define INT_LEAST16_C(c) INT16_C(c)