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

Sergei Trofimovich slyich at gmail.com
Mon Jan 3 21:20:56 CET 2011


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-0.3.0.1 -package base-4.2.0.2 -package ghc-prim-0.2.0.0 
> -package random-1.0.0.2  -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!

-- 

  Sergei
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110103/abec09c0/attachment.pgp>


More information about the Haskell-Cafe mailing list