From 81b8f80a01381057c5b11080e834cbe8faa4a45d Mon Sep 17 00:00:00 2001 From: sempiternal-aurora <78790545+sempiternal-aurora@users.noreply.github.com> Date: Mon, 27 Apr 2026 08:30:55 +1000 Subject: [PATCH] picoc: Fix gcc15 build --- pkgs/by-name/pi/picoc/gcc15-fixes.patch | 45 +++++++++++++++++++++++++ pkgs/by-name/pi/picoc/package.nix | 2 ++ 2 files changed, 47 insertions(+) create mode 100644 pkgs/by-name/pi/picoc/gcc15-fixes.patch diff --git a/pkgs/by-name/pi/picoc/gcc15-fixes.patch b/pkgs/by-name/pi/picoc/gcc15-fixes.patch new file mode 100644 index 000000000000..0e8fcabbd1d7 --- /dev/null +++ b/pkgs/by-name/pi/picoc/gcc15-fixes.patch @@ -0,0 +1,45 @@ +--- a/interpreter.h ++++ b/interpreter.h +@@ -173,6 +173,7 @@ struct ValueType + }; + + /* function definition */ ++typedef struct Value Value; /* Needed to allow reference before definition */ + struct FuncDef + { + struct ValueType *ReturnType; /* the return value type */ +@@ -180,7 +181,12 @@ struct FuncDef + int VarArgs; /* has a variable number of arguments after the explicitly specified ones */ + struct ValueType **ParamType; /* array of parameter types */ + char **ParamName; /* array of parameter names */ +- void (*Intrinsic)(); /* intrinsic call address or NULL */ ++ void (*Intrinsic)( /* intrinsic call address or NULL */ ++ struct ParseState *Parser, ++ Value *ReturnValue, ++ Value **ParamArray, ++ int ArgCount ++ ); + struct ParseState Body; /* lexical tokens of the function body if not intrinsic */ + }; + +@@ -610,8 +616,8 @@ void IncludeFile(Picoc *pc, char *Filename); + * void PicocIncludeAllSystemHeaders(); */ + + /* debug.c */ +-void DebugInit(); +-void DebugCleanup(); ++void DebugInit(Picoc *pc); ++void DebugCleanup(Picoc *pc); + void DebugCheckStatement(struct ParseState *Parser); + + +--- a/platform/library_unix.c ++++ b/platform/library_unix.c +@@ -1,6 +1,6 @@ + #include "../interpreter.h" + +-void UnixSetupFunc() ++void UnixSetupFunc(Picoc *pc) + { + } + diff --git a/pkgs/by-name/pi/picoc/package.nix b/pkgs/by-name/pi/picoc/package.nix index 2ba10f48bc8b..f26b679b49b6 100644 --- a/pkgs/by-name/pi/picoc/package.nix +++ b/pkgs/by-name/pi/picoc/package.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation { buildInputs = [ readline ]; + patches = [ ./gcc15-fixes.patch ]; + makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; env.NIX_CFLAGS_COMPILE = toString (