diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-10-28 03:47:38 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-11-29 05:22:46 -0600 |
commit | 88e399e2e647db0405caf35791a9301368eb3d7f (patch) | |
tree | d3e59df50a8979fa4791c3876277148ee30eca34 /system/easy-kernel/0208-gcc14-objtool-fix.patch | |
parent | 7fac6e084ed43016a9746e99bfb55daa7a3d1e66 (diff) | |
download | packages-88e399e2e647db0405caf35791a9301368eb3d7f.tar.gz packages-88e399e2e647db0405caf35791a9301368eb3d7f.tar.bz2 packages-88e399e2e647db0405caf35791a9301368eb3d7f.tar.xz packages-88e399e2e647db0405caf35791a9301368eb3d7f.zip |
system/easy-kernel: Update to 6.6.58-mc2
Includes oldconfigs for all arches, but only tested on ppc64 so far.
Diffstat (limited to 'system/easy-kernel/0208-gcc14-objtool-fix.patch')
-rw-r--r-- | system/easy-kernel/0208-gcc14-objtool-fix.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/system/easy-kernel/0208-gcc14-objtool-fix.patch b/system/easy-kernel/0208-gcc14-objtool-fix.patch new file mode 100644 index 000000000..dca9494ab --- /dev/null +++ b/system/easy-kernel/0208-gcc14-objtool-fix.patch @@ -0,0 +1,41 @@ +Subject: [gcc-14 PATCH] objtool: Fix calloc call for new -Walloc-size + +GCC 14 introduces a new -Walloc-size included in -Wextra which errors out +like: +``` +check.c: In function ‘cfi_alloc’: +check.c:294:33: error: allocation of insufficient size ‘1’ for type ‘struct cfi_state’ with size ‘320’ [-Werror=alloc-size] + 294 | struct cfi_state *cfi = calloc(sizeof(struct cfi_state), 1); + | ^~~~~~ +``` + +The calloc prototype is: +``` +void *calloc(size_t nmemb, size_t size); +``` + +So, just swap the number of members and size arguments to match the prototype, as +we're initialising 1 struct of size `sizeof(struct ...)`. GCC then sees we're not +doing anything wrong. + +Link: https://lore.kernel.org/all/20231107205504.1470006-1-sam@gentoo.org/ +Signed-off-by: Sam James <sam@gentoo.org> +--- + tools/objtool/check.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/objtool/check.c b/tools/objtool/check.c +index e94756e09ca9..548ec3cd7c00 100644 +--- a/tools/objtool/check.c ++++ b/tools/objtool/check.c +@@ -291,7 +291,7 @@ static void init_insn_state(struct objtool_file *file, struct insn_state *state, + + static struct cfi_state *cfi_alloc(void) + { +- struct cfi_state *cfi = calloc(sizeof(struct cfi_state), 1); ++ struct cfi_state *cfi = calloc(1, sizeof(struct cfi_state)); + if (!cfi) { + WARN("calloc failed"); + exit(1); +-- +2.42.1 |