GHC Cross Compiler Binary Distributions
As mentioned in the September Edition of What is New in Cross Compiling Haskell, I’ve been working on producing binary distributions of cross compilers, so that installing a cross compiler becomes almost as trivial as installing a GHC binary distribution.
A word of caution is in order. /These are rather experimental builds, and realistically I expect there to be a few issues, that will arise. I’d still appreciate early feedback so that we can iron out the wrinkles quickly!/
I’ve build binary distributions for from macOS Sierra to iOS, Android and Raspberry Pi, as well as binary distributions from Debian 8 to Android and Raspberry Pi.
So head on over to hackage.mobilehaskell.org and grab the binary distribution of your choice.
You will also need a copy of LLVM5 in
PATH. As well as a copy of the
bootstrapped toolchain wrapper.
$ git clone https://github.com/zw3rk/toolchain-wrapper.git $ cd toolchain-wrapper toolchain-wrapper $ ./bootstrap $ export PATH="$(PWD)/toolchain-wrapper:$PATH"
Note: you may need to adjust the
*-toolchain.config file to match
your toolchain paths.
Installing the binary distribution
While I hope that installing the binary distributions will eventually be
as simple as =./configure –prefix=… && make install= for now you will
likely need to provide
--target… –host=… –build=…= as well.
E.g. for the
aarch64-unknown-linux-android on Debian 8, you would
./configure --prefix=... \ --target=aarch64-linux-android \ --host=x86_64-pc-linux-gnu \ --build=x86_64-pc-linux-gnu make install
to satisfy the
Where to go from here
You should now be able to compile a simple
main = putStrLn "Hello World"
haskell file with your
<target>-ghc for your target. Note that for iOS
and Android you would likely want to use
-staticlib to produce a
static archive to link with your application.
Bugs & Issues
Please file any bug and issues you run into with the hackage-overlay issue tracker. That way we will have a central issue and knowledge base.