From 420eaa998ed8e3069f8137fb4bf16a75475291a7 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Wed, 30 Apr 2025 00:52:46 +0200 Subject: [PATCH] haskell.compiler.*: fix stack overrun on 32bit platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Could be observed by executing GHCi or running isocline's “test suite”. --- pkgs/development/compilers/ghc/common-hadrian.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index e180d684c359..a78b8a1a90da 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -279,6 +279,17 @@ includes = [ "configure.ac" ]; hash = "sha256-L3FQvcm9QB59BOiR2g5/HACAufIG08HiT53EIOjj64g="; }) + ] + # Fixes stack overrun in rts which crashes an process whenever + # freeHaskellFunPtr is called with nixpkgs' hardening flags. + # https://gitlab.haskell.org/ghc/ghc/-/issues/25485 + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13599 + ++ lib.optionals (lib.versionOlder version "9.13") [ + (fetchpatch { + name = "ghc-rts-adjustor-fix-i386-stack-overrun.patch"; + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/39bb6e583d64738db51441a556d499aa93a4fc4a.patch"; + sha256 = "0w5fx413z924bi2irsy1l4xapxxhrq158b5gn6jzrbsmhvmpirs0"; + }) ]; stdenv = stdenvNoCC;