`getNumberOfProcessors`的多个定义停止与cabal-install的链接

时间:2014-07-20 05:07:20

标签: haskell debian cabal beagleboneblack

我正试图将阴道安装在一个beaglebone black rev c(带有debian wheezy arm)上。它在cabal install cabal-install的后期失败了:

[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

在haskell运行时库中查看我已经定义了getNumberOfProcesses(这可以解释碰撞):

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

1 个答案:

答案 0 :(得分:1)

我在运行Raspbian的Raspberry Pi上遇到了类似的问题。

要解决此问题,我修补cabal-install.cabal-DHAS_GET_NUMBER_OF_PROCESSORS添加到cc-options mentioned here