Multiple definitions of getNumberOfProcessors communication with cabal-install installation

I am trying to get cabal 1.20 installed on beaglebone black rev c (with debian wheezy arm). In the end, cabal install cabal-installhe fails:

[75 of 76] Compiling Distribution.Client.Sandbox ( Distribution/Client/Sandbox.hs, dist/build/cabal/cabal-tmp/Distribution/Client/Sandbox.o )
[76 of 76] Compiling Main             ( Main.hs, dist/build/cabal/cabal-tmp/Main.o )
Linking dist/build/cabal/cabal ...
/usr/lib/ghc/libHSrts.a(OSThreads.o): In function `getNumberOfProcessors':
(.text+0x8): multiple definition of `getNumberOfProcessors'
dist/build/cabal/cabal-tmp/cbits/getnumcores.o:getnumcores.c:(.text+0x0): first defined here
collect2: ld returned 1 exit status
cabal: Error: some packages failed to install:
cabal-install-1.20.0.3 failed during the building phase. The exception was:
ExitFailure 1

Grabbing a haskell runtime library, I see that it is getNumberOfProcessesalready defined (which explains the collision):

root@doghouse:/# nm /usr/lib/ghc/libHSrts.a  | grep -B 3 Processors
nm: Disassembler.o: no symbols
nm: FrontPanel.o: no symbols
nm: LdvProfile.o: no symbols
         U getAllocations
         U getFullProgArgv
         U getGCStats
         U getNumberOfProcessors
nm: OldARMAtomic.o: no symbols
nm: Papi.o: no symbols
nm: Profiling.o: no symbols
nm: RetainerProfile.o: no symbols
nm: RetainerSet.o: no symbols
nm: RtsDllMain.o: no symbols
nm: Trace.o: no symbols
nm: 0Hash.o: no symbols
nm: 0Unpack.o: no symbols
nm: Dist.o: no symbols
nm: Global.o: no symbols
nm: GranSim.o: no symbols
nm: HLComms.o: no symbols
nm: LLComms.o: no symbols
nm: Pack.o: no symbols
nm: ParInit.o: no symbols
nm: ParTicky.o: no symbols
nm: Parallel.o: no symbols
nm: ParallelDebug.o: no symbols
nm: RBH.o: no symbols
nm: Sanity.o: no symbols
nm: EventLog.o: no symbols
--

OSThreads.o:
00000000 T forkOS_createThread
00000008 T getNumberOfProcessors
+4
source share
1 answer

I ran into a similar problem on Raspberry Pi, which runs Raspbian.

To fix the problem, I fixed cabal-install.cabalit to add -DHAS_GET_NUMBER_OF_PROCESSORSin cc-optionsas mentioned here .

+1
source

All Articles