haskellPackages: fix executables built for ghcjs

This commit is contained in:
Alexandre Esteves 2025-10-13 03:11:49 +01:00
parent 722f3ef97a
commit cac97ad6f6
2 changed files with 15 additions and 0 deletions

View file

@ -239,6 +239,10 @@
hash = "sha256-sb+AHdkGkCu8MW0xoQIpD5kEc0zYX8udAMDoC+TWc0Q=";
})
]
++ lib.optionals stdenv.targetPlatform.isGhcjs [
# https://gitlab.haskell.org/ghc/ghc/-/issues/26290
./export-heap-methods.patch
]
# Prevents passing --hyperlinked-source to haddock. Note that this can
# be configured via a user defined flavour now. Unfortunately, it is
# impossible to import an existing flavour in UserSettings, so patching

View file

@ -0,0 +1,11 @@
diff --git a/rts/js/mem.js b/rts/js/mem.js
index 44c5c37ac4..1f150c5d55 100644
--- a/rts/js/mem.js
+++ b/rts/js/mem.js
@@ -1,5 +1,5 @@
//#OPTIONS:CPP
-//#OPTIONS:EMCC:EXPORTED_RUNTIME_METHODS=addFunction,removeFunction,getEmptyTableSlot
+//#OPTIONS:EMCC:EXPORTED_RUNTIME_METHODS=addFunction,removeFunction,getEmptyTableSlot,HEAP8,HEAPU8
// #define GHCJS_TRACE_META 1