Skip to content

ghc-iserv-dyn: loadObj: failed to mmap() memory below 2Gb on aarch64

Summary

ghc-iserv-dyn fails with issue indicated in the title when cross compiling project comprising template haskell dependency.

Steps to reproduce

try to cross compile attached Main.hs minimum source that has dependency on wai-app-static package using template haskell.

Expected behavior

cross compiling fails with indicated issue as listed in attached ghc_output.txt file.

Environment

  • GHC version used: 8.10.2

Optional:

  • Operating System: Ubuntu 20.04.1 LTS on build host running GHC - Debian GNU/Linux 10 on target host running ghc-iserv-dyn
  • System Architecture: x86_64-linux on build host - arch64-linux on target host
  • Hardware: Dell XPS 13 9360 with 8GB memory build host - Boundary Devices i.MX8MQ Nitrogen8M with 2GB memory target host
  • Cross compiling script peculiarities:
    • the stack tool has been used for cross compiling
    • for this purpose the following scripts have been created/replaced in the standard build system on build host: -- in directory ~/.stack/programs/aarch64-linux/ghc-8.10.2/bin/ ghc -- Note that instance_host and instance_target parameters of script need to be adapted to test environment. -- in directory ~/.stack/programs/aarch64-linux/ghc-8.10.2/lib/aarch64-linux-gnu-ghc-8.10.2/bin ghc-iserv-dyn .. Note that target parameter of script needs to be adapted to test environment.
  • General remarks:
    • This issue does not occur for the same environment conditions when using GHC 8.8.3.
    • The "-xm" RTS flag for working around the issue as indicated in the build output seems not to be supported.
    • Any workaround for cross compiling template haskell modules using GHC 8.10.2 is highly appreciated.
Edited by IfSixWasNine
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information