From a6161bb9b6e3ebdb630fc4f757d4d6e4e4b2b810 Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Mon, 10 Jun 2024 14:48:16 +0200 Subject: [PATCH] Added patch for scav bco --- NixSupport/mkGhcCompiler.nix | 2 +- NixSupport/scav-bco.patch | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 NixSupport/scav-bco.patch diff --git a/NixSupport/mkGhcCompiler.nix b/NixSupport/mkGhcCompiler.nix index eb35a7274..a6f576a17 100644 --- a/NixSupport/mkGhcCompiler.nix +++ b/NixSupport/mkGhcCompiler.nix @@ -40,7 +40,7 @@ let ihpDontHaddockPackages = []; in ghcCompiler.override { ghc = if pkgs.stdenv.isDarwin - then ghcCompiler.ghc.overrideAttrs (oldAttrs: { patches = [ ./ghc-12264.patch ] ++ (oldAttrs.patches or []); }) + then ghcCompiler.ghc.overrideAttrs (oldAttrs: { patches = [ ./ghc-12264.patch ./scav-bco.patch ] ++ (oldAttrs.patches or []); }) else ghcCompiler.ghc; overrides = composeExtensionsList [ generatedOverrides diff --git a/NixSupport/scav-bco.patch b/NixSupport/scav-bco.patch new file mode 100644 index 000000000..721c4f28a --- /dev/null +++ b/NixSupport/scav-bco.patch @@ -0,0 +1,27 @@ +commit 1ed6e300d57a48129786ba2dfbda6da1e233a454 (HEAD -> wip/T23415-9.8) +Author: Ian-Woo Kim +Date: Mon May 22 12:22:33 2023 -0700 + + Add missing BCO handling in scavenge_one. + + (cherry picked from commit 902ebcc2b95707319d37a19d6b23c342cc14b162) + +diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c +index 8debec6a666..9bbe069d875 100644 +--- a/rts/sm/Scav.c ++++ b/rts/sm/Scav.c +@@ -1593,6 +1593,14 @@ scavenge_one(StgPtr p) + #endif + break; + ++ case BCO: { ++ StgBCO *bco = (StgBCO *)p; ++ evacuate((StgClosure **)&bco->instrs); ++ evacuate((StgClosure **)&bco->literals); ++ evacuate((StgClosure **)&bco->ptrs); ++ break; ++ } ++ + case COMPACT_NFDATA: + scavenge_compact((StgCompactNFData*)p); + break;