4

I am trying to cross-compile cabal-install for ARM. It has come down to installing the prerequisite packages one-by-one. I was able to configure, build and install some of the packages by following this page:

How do I install dependencies when cross compiling haskell code?

Until I got to the network package where I got this error after ./Setup build:

Setup: The program hsc2hs is required but it could not be found

After this I added the

--with-hsc2hs=arm-unknown-linux-gnueabihf-hsc2hs

switch to my configure, but this time I ran into

/opt/ghc-cross-7.8.3/bin/arm-unknown-linux-gnueabihf-hsc2hs: line 29: /opt/ghc-cross-7.8.3/lib/arm-unknown-linux-gnueabihf-ghc-7.8.3/bin/hsc2hs: cannot execute binary file: Exec format error

Apparently my arm-unknown-linux-gnueabihf-hsc2hs tool is not running on my host. Why is this happening? And why, for instance, arm-unknown-linux-gnueabihf-ghc is working but not hsc2hs? And lastly, is there workaround for installing my original network package?

Community
  • 1
  • 1
rdst15
  • 41
  • 1
  • 1
    These are good questions. But, in order to *use* your cross-compiled cabal-install, you need a GHC that runs on ARM, right? If you have that, might it not be easier to do the bootstrap entirely on ARM using that compiler, rather than your cross-compiler? I can't imagine it would take too long. – Reid Barton Oct 28 '15 at 19:08
  • I tried that but my ARM system actually hangs during 'make' which is another strange observation. I guess that is because my RAM is small < 1GB? – rdst15 Oct 28 '15 at 19:16
  • If you're trying to use GHC 7.10 on ARM, you probably want the current `master` branch. A show-stopper GHCi bug was fixed after 7.10.2 and 7.10.3 isn't out yet. I don't know anything else about it though. – dfeuer Oct 28 '15 at 19:19
  • Actaully I only want 7.8.3 because the software I eventually want to build for ARM is only supported and tested with this version. – rdst15 Oct 28 '15 at 19:27

0 Answers0