From cee79b773a187664f03a8fa76ee33bc51457ac19 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 23 Jun 2024 21:21:31 -0400 Subject: [PATCH] bash: Fix OpenBSD build See added code comment for details (cherry picked from commit 97550cd031187e597ec28c9ffd1adce4f7b4afc1) --- pkgs/shells/bash/5.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/shells/bash/5.nix b/pkgs/shells/bash/5.nix index de0426fbcdcd..dee221de7c12 100644 --- a/pkgs/shells/bash/5.nix +++ b/pkgs/shells/bash/5.nix @@ -79,6 +79,10 @@ stdenv.mkDerivation rec { "bash_cv_job_control_missing=nomissing" "bash_cv_sys_named_pipes=nomissing" "bash_cv_getcwd_malloc=yes" + # This check cannot be performed when cross compiling. The "yes" + # default is fine for static linking on Linux (weak symbols?) but + # not with OpenBSD, when it does clash with the regular `getenv`. + "bash_cv_getenv_redef=${if !(with stdenv.hostPlatform; isStatic && isOpenBSD) then "yes" else "no"}" ] ++ lib.optionals stdenv.hostPlatform.isCygwin [ "--without-libintl-prefix" "--without-libiconv-prefix"