diff --git a/boot/syslinux/0021-load_linux-correct-a-type.patch b/boot/syslinux/0021-load_linux-correct-a-type.patch new file mode 100644 index 0000000000..ff4e5a2d29 --- /dev/null +++ b/boot/syslinux/0021-load_linux-correct-a-type.patch @@ -0,0 +1,34 @@ +From 7f1b68d561dfe615d5cd73d2f4561ac032832802 Mon Sep 17 00:00:00 2001 +From: Scot Doyle +Date: Sat, 7 Feb 2015 13:52:05 -0500 +Subject: [PATCH] load_linux: correct a type + +Correct base's type to match its initialization from prot_mode_base and +passage to syslinux_memmap_find(). Tested with extlinux. + +Signed-off-by: Scot Doyle +Signed-off-by: Gene Cumm +Upstream: https://github.com/geneC/syslinux/commit/83aad4f69065509ba5b1c080edccfed316a4cff0 +Signed-off-by: Thomas Petazzoni +--- + com32/lib/syslinux/load_linux.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c +index 06ae2a97..ac737293 100644 +--- a/com32/lib/syslinux/load_linux.c ++++ b/com32/lib/syslinux/load_linux.c +@@ -155,8 +155,8 @@ int bios_boot_linux(void *kernel_buf, size_t kernel_size, + char *cmdline) + { + struct linux_header hdr, *whdr; +- size_t real_mode_size, prot_mode_size, base; +- addr_t real_mode_base, prot_mode_base, prot_mode_max; ++ size_t real_mode_size, prot_mode_size; ++ addr_t real_mode_base, prot_mode_base, prot_mode_max, base; + addr_t irf_size; + size_t cmdline_size, cmdline_offset; + struct setup_data *sdp; +-- +2.47.1 + diff --git a/boot/syslinux/0022-com32-modules-pxechn.c-use-proper-type-in-struct-dat.patch b/boot/syslinux/0022-com32-modules-pxechn.c-use-proper-type-in-struct-dat.patch new file mode 100644 index 0000000000..65ad65eff6 --- /dev/null +++ b/boot/syslinux/0022-com32-modules-pxechn.c-use-proper-type-in-struct-dat.patch @@ -0,0 +1,46 @@ +From b9514337ecfc0efaa04a926713188d87a88bb59e Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 18 Jan 2025 16:03:34 +0100 +Subject: [PATCH] com32/modules/pxechn.c: use proper type in struct data_area +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use a size_t for the size field, so that we meet the expectations of +the loadfile() function. + +Fixes a build issue with GCC >= 14: + +com32/modules/pxechn.c:985:38: error: passing argument 3 of ‘loadfile’ from incompatible pointer type [-Wincompatible-pointer-types] + 985 | if (loadfile(pxe.fn, &file.data, &file.size)) { + | ^~~~~~~~~~ + | | + | addr_t * {aka unsigned int *} + +In file included from com32/modules/pxechn.c:33: +com32/include/syslinux/loadfile.h:11:37: note: expected ‘size_t *’ {aka ‘long unsigned int *’} but argument is of type ‘addr_t *’ {aka ‘unsigned int *’} + 11 | int loadfile(const char *, void **, size_t *); + | ^~~~~~~~ + +Upstream: N/A, dead +Signed-off-by: Thomas Petazzoni +--- + com32/modules/pxechn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/com32/modules/pxechn.c b/com32/modules/pxechn.c +index e4e21e88..15f008a3 100644 +--- a/com32/modules/pxechn.c ++++ b/com32/modules/pxechn.c +@@ -130,7 +130,7 @@ struct pxelinux_opt { + struct data_area { + void *data; + addr_t base; +- addr_t size; ++ size_t size; + }; + + /* From chain.c */ +-- +2.47.1 + diff --git a/boot/syslinux/0023-com32-chain-chain.h-use-proper-type-in-struct-data_a.patch b/boot/syslinux/0023-com32-chain-chain.h-use-proper-type-in-struct-data_a.patch new file mode 100644 index 0000000000..d4b62eb234 --- /dev/null +++ b/boot/syslinux/0023-com32-chain-chain.h-use-proper-type-in-struct-data_a.patch @@ -0,0 +1,42 @@ +From 57dddf8d6d1c48aa78b9cdfb2b474aa89c3ae7c7 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 18 Jan 2025 16:11:36 +0100 +Subject: [PATCH] com32/chain/chain.h: use proper type in struct data_area +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes build issue with GCC >= 14: + +com32/chain/chain.c:517:44: error: passing argument 3 of ‘loadfile’ from incompatible pointer type [-Wincompatible-pointer-types] + 517 | if (loadfile(opt.file, &fdat.data, &fdat.size)) { + | ^~~~~~~~~~ + | | + | addr_t * {aka unsigned int *} +In file included from com32/chain/chain.c:32: +com32/include/syslinux/loadfile.h:11:37: note: expected ‘size_t *’ {aka ‘long unsigned int *’} but argument is of type ‘addr_t *’ {aka ‘unsigned int *’} + 11 | int loadfile(const char *, void **, size_t *); + | ^~~~~~~~ + +Upstream: N/A, dead +Signed-off-by: Thomas Petazzoni +--- + com32/chain/chain.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/com32/chain/chain.h b/com32/chain/chain.h +index fb5914b1..dcf43844 100644 +--- a/com32/chain/chain.h ++++ b/com32/chain/chain.h +@@ -21,7 +21,7 @@ + struct data_area { + void *data; + addr_t base; +- addr_t size; ++ size_t size; + }; + + #endif +-- +2.47.1 + diff --git a/boot/syslinux/0024-efi-main.c-fix-incorrect-type-of-load_error_buf.patch b/boot/syslinux/0024-efi-main.c-fix-incorrect-type-of-load_error_buf.patch new file mode 100644 index 0000000000..9f61745a61 --- /dev/null +++ b/boot/syslinux/0024-efi-main.c-fix-incorrect-type-of-load_error_buf.patch @@ -0,0 +1,48 @@ +From cbc8a8e25c3548771de5294f5a1eaef6bfe9b5da Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 18 Jan 2025 17:03:16 +0100 +Subject: [PATCH] efi/main.c: fix incorrect type of load_error_buf +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +load_error_buf is used as argument of setjmp()/longjmp(), so it should +be a "jmp_buf", not a "jmp_buf *". According to the setjmp/longjmp man +page: + + int setjmp(jmp_buf env); + int sigsetjmp(sigjmp_buf env, int savesigs); + +Fixes build issue with GCC >= 14: + +efi/main.c:1329:21: error: passing argument 1 of ‘setjmp’ from incompatible pointer type [-Wincompatible-pointer-types] + 1329 | if (!setjmp(load_error_buf)) + | ^~~~~~~~~~~~~~ + | | + | struct (*)[1] +x86_64-buildroot-linux-gnu/sysroot/usr/include/efi/efisetjmp.h:7:29: note: expected ‘struct *’ but argument is of type ‘struct (*)[1]’ + 7 | extern UINTN setjmp(jmp_buf env) __attribute__((returns_twice)); + | ~~~~~~~~^~~ + +Upstream: N/A dead +Signed-off-by: Thomas Petazzoni +--- + efi/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/efi/main.c b/efi/main.c +index 7dc7bca7..045dae56 100644 +--- a/efi/main.c ++++ b/efi/main.c +@@ -30,7 +30,7 @@ uint32_t timer_irq; + __export uint8_t KbdMap[256]; + char aux_seg[256]; + +-static jmp_buf *load_error_buf; ++static jmp_buf load_error_buf; + + static inline EFI_STATUS + efi_close_protocol(EFI_HANDLE handle, EFI_GUID *guid, EFI_HANDLE agent, +-- +2.47.1 +