Skip to content

Commit

Permalink
syslinux: fix GCC14 build issue
Browse files Browse the repository at this point in the history
fixes NixOS#367703

Signed-off-by: Florian Brandes <[email protected]>
  • Loading branch information
gador committed Dec 24, 2024
1 parent 8812fb6 commit 186671a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
39 changes: 39 additions & 0 deletions pkgs/by-name/sy/syslinux/gcc14.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/com32/chain/chain.c b/com32/chain/chain.c
index 4e9e32d..b11b880 100644
--- a/com32/chain/chain.c
+++ b/com32/chain/chain.c
@@ -514,7 +514,7 @@ int main(int argc, char *argv[])
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;
}
diff --git a/com32/lib/syslinux/debug.c b/com32/lib/syslinux/debug.c
index d9ab863..e8f53d5 100644
--- a/com32/lib/syslinux/debug.c
+++ b/com32/lib/syslinux/debug.c
@@ -1,6 +1,7 @@
#include <linux/list.h>
#include <string.h>
#include <stdbool.h>
+#include <stdio.h>

#ifdef DYNAMIC_DEBUG

diff --git a/com32/libupload/tftp.h b/com32/libupload/tftp.h
index 323dc16..09aa40b 100644
--- a/com32/libupload/tftp.h
+++ b/com32/libupload/tftp.h
@@ -19,4 +19,7 @@ TFTP_OK = 11, /* Not in RFC */
};

extern const char *tftp_string_error_message[];
+
+extern int tftp_put(struct url_info *url, int flags, struct inode *inode,
+ const char **redir, char *data, int data_length);
#endif
--
2.43.0
6 changes: 5 additions & 1 deletion pkgs/by-name/sy/syslinux/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ stdenv.mkDerivation {
./import-efisetjmp.patch
# Upstream patch: https://www.syslinux.org/archives/2024-February/026903.html
./define-wchar_t.patch
# https://lists.openembedded.org/g/openembedded-core/topic/patch_syslinux_fix_build/105858862
./gcc14.patch
];

postPatch = ''
Expand Down Expand Up @@ -115,7 +117,9 @@ stdenv.mkDerivation {
# gcc-10. Otherwise build fails as:
# ld: acpi/xsdt.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: multiple definition of
# `e820_types'; memory.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: first defined here
env.NIX_CFLAGS_COMPILE = "-fcommon";
# Fix GCC 14 build.
# from incompatible pointer type [-Wincompatible-pointer-types]
env.NIX_CFLAGS_COMPILE = "-fcommon -Wno-error=incompatible-pointer-types";

makeFlags =
[
Expand Down

0 comments on commit 186671a

Please sign in to comment.