From 78d9efbbe8197273945f0b5345876366f552ea3c Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Mon, 29 Sep 2025 13:31:48 +0100 Subject: [PATCH] time: fix build on non-glibc --- pkgs/by-name/ti/time/package.nix | 6 ++-- ...1.9-fix-sighandler-prototype-for-c23.patch | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 pkgs/by-name/ti/time/time-1.9-fix-sighandler-prototype-for-c23.patch diff --git a/pkgs/by-name/ti/time/package.nix b/pkgs/by-name/ti/time/package.nix index af26954c2c57..cd49f0f89850 100644 --- a/pkgs/by-name/ti/time/package.nix +++ b/pkgs/by-name/ti/time/package.nix @@ -17,11 +17,9 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # fixes cross-compilation to riscv64-linux ./time-1.9-implicit-func-decl-clang.patch + # https://lists.gnu.org/archive/html/bug-time/2025-10/msg00000.html # fix compilation with gcc15 - (fetchpatch { - url = "https://src.fedoraproject.org/rpms/time/raw/191440912c2e9a63af87802e507ca3ccb923e805/f/time-1.9-Fix-compiling-with-GCC15.patch"; - hash = "sha256-4Qp3mV8XuCmz518GPtrW52gyaPOb+97RE6FDPKNCyJw="; - }) + ./time-1.9-fix-sighandler-prototype-for-c23.patch ]; meta = { diff --git a/pkgs/by-name/ti/time/time-1.9-fix-sighandler-prototype-for-c23.patch b/pkgs/by-name/ti/time/time-1.9-fix-sighandler-prototype-for-c23.patch new file mode 100644 index 000000000000..d092fa39ef2f --- /dev/null +++ b/pkgs/by-name/ti/time/time-1.9-fix-sighandler-prototype-for-c23.patch @@ -0,0 +1,30 @@ +In C23 functions with empty argument list in the prototype are treated +as taking no arguments. This means that the `int` argument of the +sighandler must be specified explicitly or the code will fail to +compile due to mismatched function type. + +Signed-off-by: Marcin Serwin +--- +This fixes the same issue as + and + but does not +rely on `sighandler_t` which is a GNU extension. + + src/time.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/time.c b/src/time.c +index 7b401bc..88287dd 100644 +--- a/src/time.c ++++ b/src/time.c +@@ -77,7 +77,7 @@ enum + + + /* A Pointer to a signal handler. */ +-typedef RETSIGTYPE (*sighandler) (); ++typedef RETSIGTYPE (*sighandler) (int); + + /* msec = milliseconds = 1/1,000 (1*10e-3) second. + usec = microseconds = 1/1,000,000 (1*10e-6) second. */ +-- +2.51.0