A collection of libraries patched for cross compilation to ARM


Patched haskell libraries

These are a set of haskell libraries that I patched to work with ghc 8.2.0 and Cabal; some of them were also patched so as to work when cross-compiling for ARM.

Stuff that works

  • [x] madlang
  • [x] tweet-hs
  • [x] pandoc
  • [x] keter
  • [x] cabal-install
  • [ ] idris
  • [ ] purescript
  • [x] spock
  • [ ] yesod
  • [x] happy
  • [x] alex
  • [x] hsc2hs


To build them (I used cabal-install

cabal new-build --allow-newer --with-ghc=ghc-8.0.2 --with-ghc-pkg=ghc-pkg-8.0.2


The command I use for cross-compiling is:

cabal new-build --allow-newer --with-ghc=arm-unknown-linux-gnueabihf-ghc- --with-ghc-pkg=arm-unknown-linux-gnueabihf-ghc-pkg- --constraint="cryptonite -integer-gmp" --ghc-options="-opta-mcpu=cortex-a53" --hsc2hs-options=-x --configure-option='--host=x86_64-unknown-linux-gnu' --configure-option='--build=arm-unknown-linux-gnueabihf' --extra-lib-dirs="$PATH_TO_ZLIB" --extra-include-dirs="$PATH_TO_ZLIB"

You can test this out on keter, for instance. Do be forewarned that some of the libraries had template haskell stripped out, so expect the same behavior but not always the same functions available.