I'm trying to get up and running on the raspberry pi 2 with the recently released ghc binaries for armv7, available here:
https://www.haskell.org/ghc/download_ghc_7_10_2#linux_armv7
This says it was built with debian jesse, so I've installed debian jesse on my pi2. I've installed ghc successfully - at least ghci works. But there's no cabal, and apparently ghc 7.10.2 requires cabal 1.22+. The debian version of cabal is something like 1.16 (and also would install ghc 7.6.x). So I'm trying to install cabal-install from source with its bootstrap.sh script. That downloads the mtl package and builds a 'Setup' executble, then tries to execute it. But the Setup exe fails with 'illegal instruction'.
According to the download page, the 'gold' linker is required. I added that by doing
ln -s
which gold
~/bin/ld
and setting my path to include ~/bin. Same result unfortunately.
Next up I tried reinstalling the ghc binaries with gold (I think). So as root:
> ln -s `which gold` /usr/local/bin/ld
> cd ghc-7.10.2
> make install
Once again ghc was successfully installed, but the result for building cabal-install is the same:
bburdette@jessie-rpi:~/code/cabal/cabal-install$ ./bootstrap.sh
Using gcc for C compiler. If this is not what you want, set CC.
Using /usr/lib/gcc/arm-linux-gnueabihf/4.9/collect2 instead.
Checking installed packages for ghc-7.10.2...
deepseq is already installed and the version is ok.
binary is already installed and the version is ok.
time is already installed and the version is ok.
Cabal is already installed and the version is ok.
transformers is already installed and the version is ok.
mtl-2.2.1 will be installed from local tarball.
text-1.2.0.3 will be downloaded and installed.
parsec-3.1.7 will be downloaded and installed.
network-2.6.0.2 will be downloaded and installed.
old-locale-1.0.0.7 will be downloaded and installed.
old-time-1.1.0.3 will be downloaded and installed.
HTTP-4000.2.19 will be downloaded and installed.
zlib-0.5.4.2 will be downloaded and installed.
random-1.1 will be downloaded and installed.
stm-2.4.4 will be downloaded and installed.
Using local tarball for mtl-2.2.1.
[1 of 1] Compiling Main ( Setup.hs, Setup.o )
Linking Setup ...
Illegal instruction
Error during cabal-install bootstrap:
Configuring the mtl package failed.
Any ideas?
I'm wondering if the symlinks is the correct way to enable gold for this? Maybe I need to add that as a ghc option in each cabal project, or there's some other way to use gold? Or maybe that's not the issue at all?