Compiling natively GHC for ARMv7l softabi

shiftag at shiftag at
Tue Oct 17 04:41:47 UTC 2017

> shiftag at writes:
>> Hi List,
>> I would like to install GHC for my CPU which is an ARMv7L Soft-ABI
>> NEON FPU. I read some stuff on ARM and GHC related. So it appears that
>> an installation is possible but with a RPi. The problem is the stack
>> binary which has been compiled for Hard-Float target. So it should not
>> be difficult to make it work for my architecture.
> Indeed I suspect you are right; it should be fairly straightforward to
> build GHC for your platform.
>> I checked for stack sources (stack-1.5.1.tar.gz) but I have any clue
>> about how to compile it. Can you give me an hand ?
> First you will need to build GHC itself. This will be a two-step
> process:
> 1. First build a cross-compiler [1] for your ARMv7L target on a machine
> with a working GHC (e.g. an amd64 machine).
> 2. Transfer this compiler to your target and use it to build a native
> Let us know if you have any trouble.
> Cheers,
> - Ben
> [1]

Thank you.

So, I succeed to install GHC on x64 GNU/Linux machine. However, I have an issue at Stage1 while
cross-compiling. I have the following error :

# make
===--- building phase 0
make --no-print-directory -f phase=0 phase_0_builds
utils/genprimopcode/ utils/genprimopcode/dist/ No such file or directory
utils/deriveConstants/ utils/deriveConstants/dist/ No such file or
utils/genapply/ utils/genapply/dist/ No such file or directory
libraries/hpc/ libraries/hpc/dist-boot/ No such file or directory
libraries/binary/ libraries/binary/dist-boot/ No such file or directory
libraries/Cabal/Cabal/ libraries/Cabal/Cabal/dist-boot/ No such file or
libraries/ghc-boot-th/ libraries/ghc-boot-th/dist-boot/ No such file or
libraries/ghc-boot/ libraries/ghc-boot/dist-boot/ No such file or
libraries/template-haskell/ libraries/template-haskell/dist-boot/ No such
file or directory
libraries/hoopl/ libraries/hoopl/dist-boot/ No such file or directory
libraries/transformers/ libraries/transformers/dist-boot/ No such file or
libraries/terminfo/ libraries/terminfo/dist-boot/ No such file or
compiler/ compiler/stage1/ No such file or directory
utils/hsc2hs/ utils/hsc2hs/dist/ No such file or directory
utils/ghc-pkg/ utils/ghc-pkg/dist/ No such file or directory
utils/dll-split/ utils/dll-split/dist-install/ No such file or directory
ghc/ ghc/stage1/ No such file or directory
"/usr/bin/ghc" -H32m -O -Wall \
-optc-Wall -optc-fno-stack-protector \
-hide-all-packages \
-package base -package array -package time -package containers -package bytestring -package deepseq
-package process -package pretty -package directory -package unix \
--make utils/ghc-cabal/Main.hs -o utils/ghc-cabal/dist/build/tmp/ghc-cabal \
-no-user-package-db \
-Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations \
-DCABAL_VERSION=1,24,2,0 \
-DMIN_VERSION_binary_0_8_0 \
-optP-include -optPutils/ghc-cabal/cabal_macros_boot.h \
-odir bootstrapping \
-hidir bootstrapping \
-ilibraries/Cabal/Cabal \
-ilibraries/binary/src -DGENERICS \
-ilibraries/filepath \
-ilibraries/hpc \

[53 of 95] Compiling Distribution.PackageDescription (
bootstrapping/Distribution/PackageDescription.o )
utils/ghc-cabal/ recipe for target 'utils/ghc-cabal/dist/build/tmp/ghc-cabal' failed
make[1]: *** [utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

I checked Google and I found the following patch :

But it didn't work. Do you have an idea to fix it ?


More information about the ghc-devs mailing list