diff options
-rw-r--r-- | meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch | 99 | ||||
-rw-r--r-- | meta-initramfs/recipes-devtools/klibc/files/0002-mount_opts-Fix-the-mount_opts-str-length.patch | 41 | ||||
-rw-r--r-- | meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.14.bb (renamed from meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.13.bb) | 0 | ||||
-rw-r--r-- | meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.14.bb (renamed from meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.13.bb) | 0 | ||||
-rw-r--r-- | meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.14.bb (renamed from meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.13.bb) | 0 | ||||
-rw-r--r-- | meta-initramfs/recipes-devtools/klibc/klibc.inc | 4 | ||||
-rw-r--r-- | meta-initramfs/recipes-devtools/klibc/klibc_2.0.14.bb (renamed from meta-initramfs/recipes-devtools/klibc/klibc_2.0.13.bb) | 0 |
7 files changed, 143 insertions, 1 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 @@ | |||
1 | From 84bfb7a85900446e3cc96a103601052781627043 Mon Sep 17 00:00:00 2001 | ||
2 | From: Florent Revest <revest@chromium.org> | ||
3 | Date: Mon, 14 Jul 2025 19:25:04 +0200 | ||
4 | Subject: [PATCH 1/2] stdint.h: Fix build with newer clang | ||
5 | |||
6 | Recent versions of Clang introduced definitions for __*INT64_C: | ||
7 | https://github.com/llvm/llvm-project/commit/33ad474c45e6d7a0de7bc75e15e27cf6cb9ff895 | ||
8 | |||
9 | This results in these build errors: | ||
10 | |||
11 | usr/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 | |||
18 | Renaming these macros to something more unique avoids the errors. | ||
19 | |||
20 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=1d27e1732f1326eaf98f4624100f83232d843616] | ||
21 | Signed-off-by: Florent Revest <revest@chromium.org> | ||
22 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
23 | Signed-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 | |||
30 | diff --git a/usr/include/bits32/bitsize/stdint.h b/usr/include/bits32/bitsize/stdint.h | ||
31 | index 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 "" | ||
45 | diff --git a/usr/include/bits64/bitsize/stdint.h b/usr/include/bits64/bitsize/stdint.h | ||
46 | index 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" | ||
60 | diff --git a/usr/include/stdint.h b/usr/include/stdint.h | ||
61 | index 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) | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/files/0002-mount_opts-Fix-the-mount_opts-str-length.patch b/meta-initramfs/recipes-devtools/klibc/files/0002-mount_opts-Fix-the-mount_opts-str-length.patch new file mode 100644 index 0000000000..ad1f7f03a8 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0002-mount_opts-Fix-the-mount_opts-str-length.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From eaecc37c86fff0ff951e1930abdb9e51364c2d14 Mon Sep 17 00:00:00 2001 | ||
2 | From: Florent Revest <revest@chromium.org> | ||
3 | Date: Thu, 10 Jul 2025 19:39:11 +0200 | ||
4 | Subject: [PATCH 2/2] mount_opts: Fix the mount_opts str length | ||
5 | |||
6 | Newer versions of LLVM report: | ||
7 | |||
8 | usr/utils/mount_opts.c:20:3: error: initializer-string for character array is too long, array size is 8 but initializer has size 9 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization] | ||
9 | 20 | {"diratime", MS_NODIRATIME, 0, MS_NODIRATIME}, | ||
10 | | ^~~~~~~~~~ | ||
11 | |||
12 | This is indeed a bit odd. "diratime" is 9 bytes long with the \0 | ||
13 | terminator but placed into a struct that uses a static length of 8 bytes | ||
14 | for that buffer. I suppose this can cause all sorts of undefined | ||
15 | behaviors in theory but that in practice this never caused anything bad | ||
16 | because the next field is an unsigned long containing 2048 so the upper | ||
17 | bytes are 0 and act as string terminators by chance. | ||
18 | |||
19 | Anyway, fixing this helps unblock builds with newer toolchains. | ||
20 | |||
21 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=f7d9399d1035d2a70067fa6995db7ea02ed0c311] | ||
22 | Signed-off-by: Florent Revest <revest@chromium.org> | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
25 | --- | ||
26 | usr/utils/mount_opts.h | 2 +- | ||
27 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
28 | |||
29 | diff --git a/usr/utils/mount_opts.h b/usr/utils/mount_opts.h | ||
30 | index cf47cae..5195c88 100644 | ||
31 | --- a/usr/utils/mount_opts.h | ||
32 | +++ b/usr/utils/mount_opts.h | ||
33 | @@ -2,7 +2,7 @@ | ||
34 | #define UTILS_MOUNT_OPTS_H | ||
35 | |||
36 | struct mount_opts { | ||
37 | - const char str[8]; | ||
38 | + const char str[9]; | ||
39 | unsigned long rwmask; | ||
40 | unsigned long rwset; | ||
41 | unsigned long rwnoset; | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.13.bb b/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.14.bb index 4011aa231e..4011aa231e 100644 --- a/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.13.bb +++ b/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.14.bb | |||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.13.bb b/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.14.bb index 0de580781b..0de580781b 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.13.bb +++ b/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.14.bb | |||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.13.bb b/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.14.bb index 2f26093cbe..2f26093cbe 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.13.bb +++ b/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.14.bb | |||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc index 2af53b18e3..26d4ebc72c 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc.inc +++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc | |||
@@ -20,6 +20,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/libs/klibc/2.0/klibc-${PV}.tar.xz \ | |||
20 | file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \ | 20 | file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \ |
21 | file://cross-clang.patch \ | 21 | file://cross-clang.patch \ |
22 | file://0001-workaround-for-overlapping-sections-in-binary.patch \ | 22 | file://0001-workaround-for-overlapping-sections-in-binary.patch \ |
23 | file://0001-stdint.h-Fix-build-with-newer-clang.patch \ | ||
24 | file://0002-mount_opts-Fix-the-mount_opts-str-length.patch \ | ||
23 | " | 25 | " |
24 | 26 | ||
25 | ARMPATCHES ?= "" | 27 | ARMPATCHES ?= "" |
@@ -27,7 +29,7 @@ ARMPATCHES ?= "" | |||
27 | ARMPATCHES:arm = " \ | 29 | ARMPATCHES:arm = " \ |
28 | file://armv4-fix-v4bx.patch \ | 30 | file://armv4-fix-v4bx.patch \ |
29 | " | 31 | " |
30 | SRC_URI[sha256sum] = "d673a294f742d59368222ff5c38462d81098c55063799de6fb8a7ba3d4af0436" | 32 | SRC_URI[sha256sum] = "281bfb683e196818412af70b8968b7726475a80ff1c4bd67119e6bf5059f9075" |
31 | 33 | ||
32 | S = "${UNPACKDIR}/klibc-${PV}" | 34 | S = "${UNPACKDIR}/klibc-${PV}" |
33 | 35 | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc_2.0.13.bb b/meta-initramfs/recipes-devtools/klibc/klibc_2.0.14.bb index 8dda9a8cdc..8dda9a8cdc 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc_2.0.13.bb +++ b/meta-initramfs/recipes-devtools/klibc/klibc_2.0.14.bb | |||