diff --git a/flake.nix b/flake.nix index eabd9e7..0961922 100644 --- a/flake.nix +++ b/flake.nix @@ -127,6 +127,18 @@ "--disable-split-sections" "--ghc-option=-j1" "--disable-shared" + # GHC 9.10.3 bug: libHSghc-9.10.3-5702.a is truncated (last AR + # entry Expr.o claims 517544 bytes but only 82258 remain). + # GHC's internal static linker (readAr via Data.Binary.Get) panics + # after all 477 modules compile when it flushes deferred symbol + # loads from IHP's TH splices that transitively need the ghc pkg. + # Fix: delegate TH evaluation to ghc-iserv-dyn, which uses dlopen + # on libHSghc.so (intact) instead of readAr on the truncated .a. + # ghc-iserv-dyn is not in ghc-with-packages/bin/, so use -pgmi + # with the absolute path in the unwrapped GHC store path. + "--ghc-option=-fexternal-interpreter" + "--ghc-option=-pgmi" + "--ghc-option=${hprev.ghc}/lib/ghc-9.10.3/bin/ghc-iserv-dyn" ]; postUnpack = (old.postUnpack or "") + '' _actual="$sourceRoot/build/Generated/ActualTypes.hs"