cabal-install: Linking fails on arm #1129

Closed
brefan opened this Issue Nov 23, 2012 · 7 comments

Projects

None yet

2 participants

@brefan
brefan commented Nov 23, 2012

I'm trying to install cabal-install version 1.16.0.2 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 1.8.0.2 of the Cabal library

Member

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?

Member

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'

Member

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)
#define HAS_GET_NUMBER_OF_PROCESSORS
#endif
@23Skidoo 23Skidoo was assigned Nov 23, 2012
Member

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 1.16.0.2
using version 1.16.0.3 of the Cabal library

Member

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.
074691a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment