trouble building ghc-7.4 on Fedora 18 (devel) ARM

Jens Petersen juhp at
Sun Apr 22 10:19:57 CEST 2012


I have been struggling to build ghc74 on ARM (ideally with llvm3) on
Fedora 18 (the current development tree).

After applying 4 recent ARM patches from Debian the ghc-7.4.1 build gets to:

"inplace/bin/ghc-stage1"   -H32m -O    -package-name base-
-hide-all-packages -i -ilibraries/base/.
-Ilibraries/base/dist-install/build/autogen -Ilibraries/base/include
-optPlibraries/base/dist-install/build/autogen/cabal_macros.h -package
ghc-prim- -package integer-gmp- -package rts-1.0
-package-name base -XHaskell98 -XCPP -O2  -no-user-package-conf
-rtsopts     -odir libraries/base/dist-install/build -hidir
libraries/base/dist-install/build -stubdir
libraries/base/dist-install/build -hisuf hi -osuf  o -hcsuf hc -c
libraries/base/dist-install/build/GHC/Event/Clock.hs -o
[parallel build line removed]
/usr/bin/ld: error: /tmp/ghc5703_0/ghc5703_0.o uses VFP register
arguments, libraries/base/dist-install/build/GHC/Event/Clock.o does
/usr/bin/ld: failed to merge target specific data of file
collect2: error: ld returned 1 exit status
make[1]: *** [libraries/base/dist-install/build/GHC/Event/Clock.o] Error 1

(full build log at:
and more details at

I gather that it builds on Debian so I am not quite why it is failing on Fedora.

To see if ghc-7.4.2pre is any better I tried building
ghc- too (without any ARM patches),
which gets a lot further, to using llvm:

"inplace/bin/ghc-stage1"   -H32m -O    -package-name array-
-hide-all-packages -i -ilibraries/array/.
-Ilibraries/array/dist-install/build/autogen -Ilibraries/array/include
-package base-  -XHaskell98 -XMultiParamTypeClasses
-XFlexibleContexts -XFlexibleInstances -XTypeSynonymInstances
-XDeriveDataTypeable -XStandaloneDeriving -XRank2Types -XMagicHash
-XUnboxedTuples -XForeignFunctionInterface -XUnliftedFFITypes -XCPP
-O2  -no-user-package-conf -rtsopts     -odir
libraries/array/dist-install/build -hidir
libraries/array/dist-install/build -stubdir
libraries/array/dist-install/build -hisuf hi -osuf  o -hcsuf hc -c
libraries/array/./Data/Array/IO/Internals.hs -o
    Warning: -#include and INCLUDE pragmas are deprecated: They no
longer have any effect
Instruction referencing instruction not embedded in a basic block!
  %ln2ulc = getelementptr inbounds i32* %Sp_Arg, i32 3
  %ln2uld = ptrtoint i32* %ln2ulc to i32
Instruction does not dominate all uses!
  %ln2ulc = getelementptr inbounds i32* %Sp_Arg, i32 3
  tail call cc10 void @stg_ap_ppp_fast(i32* %Base_Arg, i32* %ln2ulc,
i32* %ln2uk8, i32 %ln2uky, i32 ptrtoint
to i32), i32 %ln2ul2, i32 %ln2ul6, i32 %SpLim_Arg) nounwind
Broken module found, compilation aborted!
0 0x4058f348
1 0x4058f7b4
2      0x4150a0b0 __default_sa_restorer_v2 + 0
3      0x41508c7c gsignal + 64
4      0x4150a2bc abort + 432
5 0x406f88e0
6 0x406e7678
llvm::FPPassManager::runOnFunction(llvm::Function&) + 440
7 0x406e7760
llvm::FPPassManager::runOnModule(llvm::Module&) + 48
8 0x406e733c
llvm::MPPassManager::runOnModule(llvm::Module&) + 396
9 0x406e7484 llvm::PassManagerImpl::run(llvm::Module&) + 108
10 opt            0x00014528 main + 2268
11      0x414f2dd0 __libc_start_main + 272
Stack dump:
0.	Program arguments: opt /tmp/ghc22413_0/ghc22413_0.ll -o
/tmp/ghc22413_0/ghc22413_0.bc -O2
1.	Running pass 'Function Pass Manager' on module
2.	Running pass 'Module Verifier' on function '@seuH_info'
make[1]: *** [libraries/template-haskell/dist-install/build/Language/Haskell/TH/Syntax.o]
Error 1

(full log at,
more details at

I haven't tried HEAD yet though the results at
are not too encouraging.

Perhaps I will try building ghc74 on ARM without llvm first, and maybe
on Fedora 17 too?

Anyway thoughts on how to proceed?

Thanks, Jens

ps There is actually a proposal to make ARM a Fedora 18 Primary
Architecture - though personally I feel it is a bit too early yet - if
that happens then this would become a more serious problem, though I
know ARM is still not a Tier 1 ghc platform.

More information about the Glasgow-haskell-users mailing list