Interestingly, as I was trying to compile pandoc 2.8 on Raspberry Pi 4 I encountered the following error:
[129 of 157] Compiling Text.Pandoc.Readers.LaTeX
ghc: internal error: getMBlock: mmap: Invalid argument
(GHC version 8.4.4 for arm_unknown_linux)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
cabal: Leaving directory '/tmp/cabal-tmp-4329/pandoc-2.8'
cabal: Error: some packages failed to install:
pandoc-2.8-7DuyvaKAuuG7FMyA94fihL failed during the building phase. The
exception was:
ExitFailure (-6)
So it seems to be compiler bug very similar to https://gitlab.haskell.org/ghc/ghc/issues/16383
But looking at https://gitlab.haskell.org/ghc/ghc/issues/7500 it seems this error can be related to insufficient memory?
I checked and the memory used is Maximum resident set size (kbytes): 2963812
And from https://www.raspberrypi.org/forums/viewtopic.php?t=244367 the max amount of memory per process is 3GiB on 32bit Linux as 1GB virtual memory is locked.
IIRC, pandoc 2.7.3 compiles using around 2.8 GiB. So pandoc 2.8 seems to require more memory to compile. I wonder if the same problem is seen in Linux x86.