From 19b2d2acefe30e969cbaa46cdf00409ec1cecc9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 27 Apr 2026 12:06:06 +0200 Subject: [PATCH] zsh: fix sigsuspend probe under autoconf 2.73 / C23 autoconf 2.73 makes AC_PROG_CC pick -std=gnu23, which rejects the K&R handler in the zsh_cv_sys_sigsuspend probe. The compile failure flips the probe to "no", defines BROKEN_POSIX_SIGSUSPEND, and the resulting racy pause() fallback hangs $(...) on a lost SIGCHLD. Upstream dropped the probe in 8dd271fdec52; that does not apply on 5.9 with the PCRE backports here, so just prototype the handler. Fixes #513543 Fixes #513019 --- .../zs/zsh/fix-sigsuspend-probe-c23.patch | 17 +++++++++++++++++ pkgs/by-name/zs/zsh/package.nix | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 pkgs/by-name/zs/zsh/fix-sigsuspend-probe-c23.patch diff --git a/pkgs/by-name/zs/zsh/fix-sigsuspend-probe-c23.patch b/pkgs/by-name/zs/zsh/fix-sigsuspend-probe-c23.patch new file mode 100644 index 000000000000..46c060b235d2 --- /dev/null +++ b/pkgs/by-name/zs/zsh/fix-sigsuspend-probe-c23.patch @@ -0,0 +1,17 @@ +Prototype the K&R handler so the probe still compiles under -std=gnu23 +(selected by autoconf 2.73). Upstream removed the probe in 8dd271fdec52, +which does not apply against 5.9 with the PCRE backports. + +https://github.com/NixOS/nixpkgs/issues/513543 +--- a/configure.ac ++++ b/configure.ac +@@ -2334,8 +2334,7 @@ if test x$signals_style = xPOSIX_SIGNALS; then + #include + #include + int child=0; +-void handler(sig) +- int sig; ++void handler(int sig) + {if(sig==SIGCHLD) child=1;} + int main() { + struct sigaction act; diff --git a/pkgs/by-name/zs/zsh/package.nix b/pkgs/by-name/zs/zsh/package.nix index fda96e5f40e5..1ec13496c599 100644 --- a/pkgs/by-name/zs/zsh/package.nix +++ b/pkgs/by-name/zs/zsh/package.nix @@ -63,6 +63,9 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-bl1PG9Zk1wK+2mfbCBhD3OEpP8HQboqEO8sLFqX8DmA="; excludes = [ "ChangeLog" ]; }) + # autoconf 2.73 picks -std=gnu23, breaking the K&R sigsuspend probe and + # causing $(...) hangs. Drop with the next zsh release. + ./fix-sigsuspend-probe-c23.patch ] ++ lib.optionals stdenv.cc.isGNU [ # Fixes compilation with gcc >= 14.