1

I am using Arch Linux Arm hard float and there isn't any binary packages for GHC available for armv6. How would you cross compile GHC for the Raspberry Pi so that I can compile Haskell code? Is the .deb package compatible with the Arch Linux ARM userspace? How would I install GHC from there?

2
  • Is it actually dependent on itself or is this a bug in the PKGBUILD? Commented Oct 19, 2012 at 20:51
  • @AlexChamberlain The GHC is written in Haskell. So you would need a haskell compiler(Eg: GHC) to compile GHC. Commented Oct 19, 2012 at 20:57

2 Answers 2

2

This is known as a bootstrap problem and is often encountered when cross compiling scripting languages. For example, Python has (or had) similar problems. It's one of the trickiest (and most annoying) issues you'll face when doing embedded work.

There's some info here: http://hackage.haskell.org/trac/ghc/wiki/CrossCompilation

I know it's bad form to just post links on Stack Exchange but since I have zero Haskell experience that's the best I can do.

0

You won't be able to install debian .deb files on Arch as it uses pacman to manage packages instead of aptitude. You can just pacman -S ghc to install the precompiled binary for armv5 (it's in extra/), so there's no need to cross-compile it. Of course if you wanted to specifically use a version compiled for armv6, you would have to install the armv5 one first to be able to compile another version.

4
  • @Haskeller Which version of Arch are you using? This answer is for the old soft float version. Commented Oct 21, 2012 at 10:41
  • It looks like bootstrapping GHC from an older version would have severe difficulties on a 256 MB machine. This could be achieved with patience and a big swap file on a USB HD. Given the OP's user name, I suspect they want to run the latest and greatest Haskell, and the v6.something on Arch won't cut it.
    – scruss
    Commented Oct 21, 2012 at 18:02
  • @AlexChamberlain I am using the hard float version. Is it able run on the hard float compiled userspace? Commented Oct 21, 2012 at 18:14
  • @Haskeller No... raspberrypi.stackexchange.com/q/1209/86 Commented Oct 21, 2012 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.