A collection of libraries patched for cross compilation to ARM

root

Patched haskell libraries

These are a set of haskell libraries that I patched to work with ghc 8.2.0 and Cabal 2.1.0.0; 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

Use

To build them (I used cabal-install 2.1.0.0):

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

Cross-compiling

The command I use for cross-compiling is:

cabal new-build --allow-newer --with-ghc=arm-unknown-linux-gnueabihf-ghc-8.2.0.20170404 --with-ghc-pkg=arm-unknown-linux-gnueabihf-ghc-pkg-8.2.0.20170404 --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.