Description: GCC-14 compatibility patch

* Disable FCF protection on i386, where it's not supported. 
* Add missing include to resolve implicit printf() function declaration.
* Add missing header file for long jumps in efi/main.c, fix invocations.
* Type-cast addr_t pointer to size_t, assumes that their size is the same.

Author: Marek Benc <benc.marek.elektro98@proton.me>
Bug-Debian: https://bugs.debian.org/1091027
Last-Update: 2025-04-11

--- syslinux-6.04~git20190206.bf6db5b4+dfsg1.orig/mk/embedded.mk
+++ syslinux-6.04~git20190206.bf6db5b4+dfsg1/mk/embedded.mk
@@ -24,6 +24,7 @@ GCCOPT :=
 ifeq ($(ARCH),i386)
 	GCCOPT := $(call gcc_ok,-m32)
 	GCCOPT += $(call gcc_ok,-march=i386)
+	GCCOPT    += $(call gcc_ok,-fcf-protection=none,)
 	GCCOPT    += $(call gcc_ok,-mpreferred-stack-boundary=2,)
 	GCCOPT    += $(call gcc_ok,-mincoming-stack-boundary=2,)
 endif

--- syslinux-6.04~git20190206.bf6db5b4+dfsg1.orig/com32/lib/syslinux/debug.c
+++ syslinux-6.04~git20190206.bf6db5b4+dfsg1/com32/lib/syslinux/debug.c
@@ -1,4 +1,5 @@
 #include <linux/list.h>
+#include <stdio.h>
 #include <string.h>
 #include <stdbool.h>

--- syslinux-6.04~git20190206.bf6db5b4+dfsg1.orig/efi/main.c
+++ syslinux-6.04~git20190206.bf6db5b4+dfsg1/efi/main.c
@@ -6,6 +6,7 @@
 #include <core.h>
 #include <fs.h>
 #include <com32.h>
+#include <setjmp.h>
 #include <syslinux/memscan.h>
 #include <syslinux/firmware.h>
 #include <syslinux/linux.h>
@@ -184,7 +185,7 @@
      * Inform the firmware that we failed to execute correctly, which
      * will trigger the next entry in the EFI Boot Manager list.
      */
-    longjmp(&load_error_buf, 1);
+    longjmp(load_error_buf, 1);
 }
 
 void bios_timer_cleanup(void)
@@ -1382,7 +1383,7 @@
 		status = uefi_call_wrapper(in->ReadKeyStroke, 2, in, &key);
 	} while (status == EFI_SUCCESS);
 
-	if (!setjmp(&load_error_buf))
+	if (!setjmp(load_error_buf))
 		load_env32(NULL);
 
 	/* load_env32() failed.. cancel timer and bailout */

--- syslinux-6.04~git20190206.bf6db5b4+dfsg1.orig/com32/chain/chain.c
+++ syslinux-6.04~git20190206.bf6db5b4+dfsg1/com32/chain/chain.c
@@ -514,7 +514,7 @@
     if (opt.file) {
 	fdat.base = (opt.fseg << 4) + opt.foff;
 
-	if (loadfile(opt.file, &fdat.data, &fdat.size)) {
+	if (loadfile(opt.file, &fdat.data, (size_t *)&fdat.size)) {
 	    error("Couldn't read the boot file.");
 	    goto bail;
 	}

