From f4066cd966b57780c8c964158e1fbeb386a63ea6 Mon Sep 17 00:00:00 2001 From: ghpzin Date: Thu, 3 Apr 2025 22:45:49 +0300 Subject: [PATCH] as31: fix build with gcc14 - add patch from debian: https://salsa.debian.org/debian/as31/-/blob/76735fbf1fb00ce70ffd98385137908b7bd9bd5c/debian/patches/update_sizebuf_types.patch fixing `incompatible-pointer-types` errors with gcc14: ``` run.c: In function 'run_as31': run.c:109:41: error: passing argument 2 of 'getline' from incompatible pointer type 109 | if (getline(&lineBuffer,&sizeBuf,finPre) == -1) | ^~~~~~~~ | | | int * In file included from /nix/store/kj8hbqx4ds9qm9mq7hyikxyfwwg13kzj-glibc-2.40-36-dev/include/stdio.h:966, from run.c:2: /nix/store/kj8hbqx4ds9qm9mq7hyikxyfwwg13kzj-glibc-2.40-36-dev/include/bits/stdio.h:118:36: note: expected 'size_t *' {aka 'long unsigned int *'} but argument is of type 'int *' 118 | getline (char **__lineptr, size_t *__n, FILE *__stream) | ~~~~~~~~^~~ run.c:135:68: error: passing argument 2 of 'getline' from incompatible pointer type 135 | if (getline(&incLineBuffer,&incSizeBuf,includeFile) == -1) | ^~~~~~~~~~~ | | | int * /nix/store/kj8hbqx4ds9qm9mq7hyikxyfwwg13kzj-glibc-2.40-36-dev/include/bits/stdio.h:118:36: note: expected 'size_t *' {aka 'long unsigned int *'} but argument is of type 'int *' 118 | getline (char **__lineptr, size_t *__n, FILE *__stream) | ~~~~~~~~^~~ ``` --- pkgs/by-name/as/as31/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/as/as31/package.nix b/pkgs/by-name/as/as31/package.nix index 2936f7a79958..d2ba3b530cd1 100644 --- a/pkgs/by-name/as/as31/package.nix +++ b/pkgs/by-name/as/as31/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchurl, + fetchpatch, bison, }: @@ -18,6 +19,12 @@ stdenv.mkDerivation rec { patches = [ # Check return value of getline in run.c ./0000-getline-break.patch + + # fix build with gcc14 + (fetchpatch { + url = "https://salsa.debian.org/debian/as31/-/raw/76735fbf1fb00ce70ffd98385137908b7bd9bd5c/debian/patches/update_sizebuf_types.patch"; + hash = "sha256-ERrPdY0afKwXmdSLoWmWR55nKfvmieGlz+nhwFWRnrM="; + }) ]; postPatch = ''