GHC on bananapi/arch

I’m looking at switching over to Arch linux for the Cyclophone project, partly because ghc is more up to date on arch. ghci, the haskell interpreter, actually works on arch which is nice. ghci doesn’t work on raspian or other ARM distros I’ve tried. The ghc/ghci version on arch now is 7.8.2.

Unfortunately the version of LLVM (3.5.1) on arch is too new and breaks ghc when you actually try to compile something. The errors start with:

You are using a new version of LLVM that hasn't been tested yet!"

Followed by a lot of these:
Alias must point to a definition
i8* @"base_GHCziBase_DZCFunctor_static_info$alias"

Looks like this is a known problem, slated for fixing in ghc 7.10.x. Ticket is here.

Either I could compile 7.10 and go with that, or I could downgrade llvm. Seeing as there might be a lot of breaking changes in 7.10, I’d rather go 7.8.2, so downgrading it is.

The main package rollback website for Arch only addresses x86 architectures, not ARM. After inquiries on IRC (#archlinux-arm on freenode) I was directed here:

Ed: link above is toast. see comments below for download links.

And found a list of possible replacement packages for llvm and llvm-libs, both of which were installed on my system after adding ghc.

I decided to go with 3.4.2, so I got those onto my banana pi with wget:

> wget
> wget

Because its a banana pi, I want to use the armv7 packages – the armv6 stuff is for raspberry pi. You can verify that info on your system with:

> cat /proc/cpuinfo

Ok now with those packages located and downloaded, downgrading is simple:

> sudo pacman -U llvm-3.4.2-1.1-armv7h.pkg.tar.xz llvm-libs-3.4.2-1.1-armv7h.pkg.tar.xz

This replaced the existing llvm and llvm-libs packages without disturbing their dependencies, in my case ghc. After that the cyclophone main program, scoscdir, compiles without a hitch, and without the tweaks I’ve been adding to libs because of old ghc versions on raspian.


5 thoughts on “GHC on bananapi/arch

  1. Hey, i have encountered a similar problem after installing ghc (version 7.8) with llvm (newest is 3.6) on my banana, but the links dont work anymore and i cant find another arm rollback machine. Do you, by any chance, know where the rollback machine is now or send me packages in case you have also updated to 7.8


      1. Thanks for the link, had the same issue as pb with the rollback mirrors being down.

        I’d also like to add that this “fix” works perfectly on the Raspberry Pi 2 as well.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s