[Haskell-cafe] GHC > 6.8.2 on IA64-Linux platform (Itanium)

Karel Gardas karel.gardas at centrum.cz
Tue Jan 4 09:12:55 CET 2011

Hello Sergei!

nice to hear from you! In fact I've been dealing with this issue a 
little bit and just "fixed" Adjustor issue myself and then just hour 
before your email came I discovered your excellent gentoo patches! Kudos 
to zygoloid for his excellent MBlock.h patch! Also you have saved my own 
time by noting that your patches are already upstream. I've been already 
thinking about submitting new issue and attaching them there. So I'll 
just modify platforms wiki and add some notes how to go over IA/Linux 
ghc 6.8.2 <-> 7.0.1 gab by using gentoo's patches.


On 01/ 3/11 09:20 PM, Sergei Trofimovich wrote:
> On Sun, 02 Jan 2011 18:09:05 +0100
> Karel Gardas<karel.gardas at centrum.cz>  wrote:
>> I'd like to compile more recent than 6.8.2 GHC on itanium-linux system I
>> do have access to, but I'm kind of unlucky with this. I'm trying
>> unregisterised build (of 6.12.3 and 6.10.4) and it always fails with:
>> "inplace/bin/ghc-stage2"   -H32m -O    -package-name dph-base-0.4.0
>> -hide-all-packages -i -ilibraries/dph/dph-base/.
>> -ilibraries/dph/dph-base/dist-install/build
>> -ilibraries/dph/dph-base/dist-install/build/autogen
>> -Ilibraries/dph/dph-base/dist-install/build
>> -Ilibraries/dph/dph-base/dist-install/build/autogen
>> -Ilibraries/dph/dph-base/include    -optP-include
>> -optPlibraries/dph/dph-base/dist-install/build/autogen/cabal_macros.h
>> -package array- -package base- -package ghc-prim-
>> -package random-  -Odph -funbox-strict-fields -haddock -fcpr-off
>> -XTypeFamilies -XGADTs -XRankNTypes -XBangPatterns -XMagicHash
>> -XUnboxedTuples -XTypeOperators -O2 -XGenerics
>> -fno-warn-deprecated-flags -Wwarn     -odir
>> libraries/dph/dph-base/dist-install/build -hidir
>> libraries/dph/dph-base/dist-install/build -stubdir
>> libraries/dph/dph-base/dist-install/build -hisuf hi -osuf  o -hcsuf hc
>> -c libraries/dph/dph-base/./Data/Array/Parallel/Base/Hyperstrict.hs -o
>> libraries/dph/dph-base/dist-install/build/Data/Array/Parallel/Base/Hyperstrict.o
>> ghc-stage2: internal error: evacuate: strange closure type 15
>>       (GHC version 6.12.3 for ia64_unknown_linux)
>>       Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
>> make[1]: ***
>> [libraries/dph/dph-base/dist-install/build/Data/Array/Parallel/Base/Hyperstrict.o]
>> Aborted
>> make: *** [all] Error 2
> [snip]
>> I've also seen, the last available GHC in Debian for IA64 platform is
>> 6.8.2 -- which I'm using for bootstrap btw so debian will not help me
>> here with some clever patch which would change recent ghc to be buildable...
>> So, I'd like to ask here: is there anybody who was lucky enough to find
>> appropriate set of options or any other magic way how to compile more
>> recent GHC sources to the _stable_ compiler binary on IA64/Linux? If so,
>> please let me know.
> Hello Karel!
> You have hit a nasty Garbage Collector bug in ghc. I (re)discovered it some months
> ago too. There is yet some patches to make stuff work on ia64.
> I think it will be simpler for you to get gentoo's ia64 binaries (unregisterised)
> and bootstrap ghc-HEAD yourself.
>      http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-6.12.3-ia64-haddock.tbz2
>      http://mirrors.kernel.org/gentoo/distfiles/ghc-bin-6.12.3-ia64-haddock.tbz2
> We, gentoo, apply patches for ghc-6.12.3 to make magic happen (all gone upstream
> and ghc-7.0/ghc-7.0.1)
>      http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-lang/ghc/files/
> In case you will decide to bootstrap stable ghc-6.12.3 the following patches should suffice.
> == required patches ==
> *  GC patch (the critical one, fixes bug you have posted)
>      http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-lang/ghc/files/ghc-6.12.3-ia64-storage-manager-fix.patch?revision=1.1&view=markup
> *  you need to pass -G0 to gcc when you build ghc. Gentoo does
>      it in a special manner: we add the following to mk/build.mk:
>          SRC_HC_OPTS += -optc-G0
>      Your approach might be different. It solves known(?) limitation of small object's
>      section size.
> == nice to have patches ==
> *  remove crufty linker flags in order to able to link ghc on recent binutils
>      http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-lang/ghc/files/ghc-6.12.3-ia64-fixed-relax.patch?revision=1.1&view=markup
> *  f.i.w calls on ia64 (fixes terminfo and thus interactive darcs, otherwise it will SIGSEGV)
>      http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-lang/ghc/files/ghc-6.12.3-ia64-use-libffi-for-foreign-import-wrapper.patch?view=markup
> *  If you plan to build haddock using unregistered ghc you'll need one more patch
>      to export needed API (backported from -HEAD).
>      http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-lang/ghc/files/ghc-6.12.3-ghciless-haddock-3558.patch?revision=1.1&view=markup
> Good luck!

More information about the Glasgow-haskell-users mailing list