diff --git a/pkgs/development/compilers/ghc/9.2.4.nix b/pkgs/development/compilers/ghc/9.2.4.nix index cfbc403a3891..68657c9178a0 100644 --- a/pkgs/development/compilers/ghc/9.2.4.nix +++ b/pkgs/development/compilers/ghc/9.2.4.nix @@ -194,6 +194,14 @@ stdenv.mkDerivation (rec { extraPrefix = "utils/haddock/"; stripLen = 1; }) + # Don't generate code that doesn't compile when --enable-relocatable is passed to Setup.hs + # Can be removed if the Cabal library included with ghc backports the linked fix + (fetchpatch { + url = "https://github.com/haskell/cabal/commit/6c796218c92f93c95e94d5ec2d077f6956f68e98.patch"; + stripLen = 1; + extraPrefix = "libraries/Cabal/"; + sha256 = "sha256-yRQ6YmMiwBwiYseC5BsrEtDgFbWvst+maGgDtdD0vAY="; + }) ]; postPatch = "patchShebangs ."; diff --git a/pkgs/development/compilers/ghc/9.2.5.nix b/pkgs/development/compilers/ghc/9.2.5.nix index b7798ad044aa..12511c761391 100644 --- a/pkgs/development/compilers/ghc/9.2.5.nix +++ b/pkgs/development/compilers/ghc/9.2.5.nix @@ -194,6 +194,14 @@ stdenv.mkDerivation (rec { extraPrefix = "utils/haddock/"; stripLen = 1; }) + # Don't generate code that doesn't compile when --enable-relocatable is passed to Setup.hs + # Can be removed if the Cabal library included with ghc backports the linked fix + (fetchpatch { + url = "https://github.com/haskell/cabal/commit/6c796218c92f93c95e94d5ec2d077f6956f68e98.patch"; + stripLen = 1; + extraPrefix = "libraries/Cabal/"; + sha256 = "sha256-yRQ6YmMiwBwiYseC5BsrEtDgFbWvst+maGgDtdD0vAY="; + }) ]; postPatch = "patchShebangs .";