Skip to content

Failure to build cross-compiling GHC for Raspberry Pi

It's possible I've uncovered an actual bug in my GCC, which is from this AUR package, but I was hoping you could tell me whether it looks like I'm doing something wrong first.

My build.mk is:

Stage1Only = YES
HADDOCK_DOCS = NO
INTEGER_LIBRARY = integer-simple
WITH_TERMINFO = NO
BuildFlavour = quick

which is taken straight from the GHC wiki. In particular, without WITH_TERMINFO = NO the build fails looking for ncurses.

I then run:

# due to ghcup's message about autoconf >= 2.70 (I have 2.71)
git clone https://gitlab.haskell.org/ghc/ghc/snippets/2040.git
rm -rf 2040/.git # else gets confused, expects all contents to be patches
rm 2040/ghc-8.10.patch # diff can't be applied to this version

ghcup compile ghc -j 4 -v 8.10.5 -b 8.10.5 -x arm-linux-gnueabihf --config $(pwd)/build.mk -p $(pwd)/2040 -- --enable-unregisterised

This fails with arm-linux-gnueabihf-gcc: internal compiler error: Killed (program cc1). Full log here. I can't see anything useful there. Presumably there's some way to get the right args to gcc to tell it to run with higher verbosity?

It appears from looking at the source that specifying --config causes the default build.mk that ghcup would otherwise write to be overwritten, but as far as I can tell, there isn't anything important there that I'm not already specifying. Additionally, I'm not totally sure whether I'm applying the patch correctly.

And if this is just a GCC issue, any idea how to extract something useful to report as a bug there?

Edited by George Thomas
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information