cabal-install: Linking fails on arm #1129

brefan opened this Issue Nov 23, 2012 · 7 comments


None yet

2 participants

brefan commented Nov 23, 2012

I'm trying to install cabal-install version with
a preinstalled (via apt-get) version of cabal

when issueing
cabal install cabal-install
linking fails with
cannot find -lHSrts_thr

:~# cabal --version
cabal-install version 0.8.0
using version of the Cabal library


It says that it's not able to find the threaded RTS. Is it supported on ARM? What happens if you try to build a helloworld program with -threaded?


A workaround: edit the .cabal file manually and remove -threaded from ghc-options.

brefan commented Nov 23, 2012

I don't suppose arm supports a threaded RTS.
In any case libHSrts_thr.a is not there after installing cabal-install via apt-get.
A helloworld program without -threaded compiles (and works) just fine. With -threaded I get
/usr/bin/ld: cannot find -lHSrts_thr

Removing the -threaded option from the cabal-install.cabal file seems to do the trick, though now I get:
dist/build/cabal/cabal-tmp/Distribution/Client/Utils.o: In function s6YN_ret': ghc23840_0.hc:(.text+0x7fc): undefined reference togetNumberOfProcessors'


That's because it thinks that you're using the threaded RTS and GHC >= 6.12, which includes the getNumberOfProcessors function. Edit cbits/getnumcores.c and remove this bit from the beginning:

#if defined(__GLASGOW_HASKELL__) && (__GLASGOW_HASKELL__ >= 612)
@23Skidoo 23Skidoo was assigned Nov 23, 2012

We should probably add a configure check for whether GHC supports -threaded.

brefan commented Nov 23, 2012

That worked. Thanks a lot.

:~# .cabal/bin/cabal --version
cabal-install version
using version of the Cabal library


Closing this in favour of #1131.

@23Skidoo 23Skidoo closed this Nov 23, 2012
@23Skidoo 23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Nov 26, 2012
@23Skidoo 23Skidoo Do not link with threaded RTS on ARM.
GHC on ARM doesn't have a threaded RTS, which makes it impossible to build
cabal-install without editing the source by hand (see #1129). This patch makes
cabal-install compile out of the box on ARM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment