Building GHC 8.4.3 Cross-Compiler Linux x86 -> Linux ARM

Moritz Angermann moritz.angermann at gmail.com
Tue May 28 10:01:01 UTC 2019


Hi Michael,

any reason you want to build specifically 8.4.3?  And any specific
reason you want to use 8.0.2 to build it?  Anyway, you likely don't
want to build unregistered, but use the llvm backend.

You want to set the BuildFlavour to quick-cross, e.g. with

sed -E "s/^#BuildFlavour[ ]+= quick-cross$/BuildFlavour = quick-cross/" < mk/build.mk.sample > mk/build.mk 

Once you have your compiler built, you'll likely want to use toolchain
wrapper[1] to make things a bit easier.

If you just want to try to build some simple code for a raspberry pi, you
could also try the experimental pre-built cross compilers from[2]

Cheers,
 Moritz

--

[1]: https://github.com/zw3rk/toolchain-wrapper
[2]: http://hackage.mobilehaskell.org/

> On May 28, 2019, at 5:25 AM, Ben Gamari <ben at smart-cactus.org> wrote:
> 
> Michael Dunn <michaelsdunn1 at gmail.com> writes:
> 
>> Ben,
>> 
>> I saw that you responded to my question in #ghc on freenode last
>> weekend (mdunnio), and I missed your message.
>> 
> Michael,
> 
> I would be happy to help. I'm CCing ghc-devs so others may benefit from
> this discussion.
> 
>> I'm trying to build a cross compiler using ghc 8.0.1 to build ghc
>> 8.4.3. You mentioned that you have experience.
>> 
>> Have you tried on newer versions of GHC? I've looked at a few guides
>> (mostly https://gitlab.haskell.org/ghc/ghc/wikis/building/cross-compiling)
>> and they all are using pre-8.0. The problem I'm running into now just
>> seems to be that I can't build the base packages (ghc-pkg
>> specifically).
>> 
>> My configure command is:
>> 
>> ./configure --target=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc
>> --enable-unregisterised
>> 
> This is helpful to know but you didn't specify what your `make`
> invocation looks like or your mk/build.mk. It would be very helpful to
> know both of these things.
> 
> Presumably you at least had to set `HADDOCK_DOCS=NO` since otherwise the
> build system fails very early on.
> 
> Cheers,
> 
> - Ben
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs



More information about the ghc-devs mailing list