File: 0020-gcc-14-compatibility.patch

package info (click to toggle)
syslinux 3%3A6.04~git20190206.bf6db5b4%2Bdfsg1-3.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,020 kB
  • sloc: ansic: 189,354; asm: 5,148; pascal: 4,825; makefile: 1,981; perl: 1,980; python: 266; sh: 185; xml: 39
file content (71 lines) | stat: -rw-r--r-- 2,359 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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;
 	}