compiling GHC with a custom path to GCC

Donald Bruce Stewart dons at cse.unsw.edu.au
Thu Feb 17 20:02:06 EST 2005


rturk:
> [Resent, with a few #ifdef FOO's removed from the body (still in
> the attachement, and using gzip instead of bzip2 to prevent
> "awaiting moderation ;)]
> 
> On Thu, Feb 17, 2005 at 11:29:41AM -0000, Simon Marlow wrote:
> > On 17 February 2005 11:12, Remi Turk wrote:
> > 
> > > when compiling the new ghc pre-releases made my gcc 2.95.3 die
> > > with "internal compiler error", I tried to compile it with gcc
> > > 3.4.3 (or rather, I thought it compiled with 3.4.1, and when that
> > > died, compiled+installed gcc 3.4.3, tried again, say it die again
> > > and only then noticed it was actually still using 2.95.3 ;) but
> > > had quite some difficulty to actually get it to compile with, in
> > > my case, /usr/local/bin/gcc3
> > > 
> > > When using the following command-line
> > > 
> > > CC=gcc3 CXX=g++3 nice ./configure --enable-hopengl
> > > --prefix=/var/tmp/ghc --with-gcc=/usr/local/bin/gcc3 
> > > 
> > > stage1 still used gcc 2.95.3 to compile stage2 (okay, for --with-gcc
> > > that's documented) 
> > 
> > Really?  --with-gcc should set the gcc for stage1, AFAIK.  Is there a
> > bug here?
> > 
> > I've noticed gcc 2.95 crashing on my FreeBSD box too.  I should look
> > into whether there's a workaround, otherwise we're hosed on FreeBSD 4.x.
> > 
> > Cheers,
> > 	Simon
> 
> In case you've got nothing else left to do.. ;)
> 
> The ghc command which perfectly repeatable kills gcc:
> 
> make[2]: Entering directory `/var/tmp/ghc-6.4.20050216/ghc/compiler'
> ../../ghc/compiler/stage1/ghc-inplace -H16m -O  -istage2/utils  -istage2/basicTypes  -istage2/types  -istage2/hsSyn  -istage2/prelude  -istage2/rename  -istage2/typecheck  -istage2/deSugar  -istage2/coreSyn  -istage2/specialise  -istage2/simplCore  -istage2/stranal  -istage2/stgSyn  -istage2/simplStg  -istage2/codeGen  -istage2/main  -istage2/profiling  -istage2/parser  -istage2/cprAnalysis  -istage2/compMan  -istage2/ndpFlatten  -istage2/iface  -istage2/cmm  -istage2/nativeGen  -istage2/ghci -Istage2 -DGHCI -package template-haskell -package unix -package readline -DUSE_READLINE -package Cabal -cpp -fglasgow-exts -fno-generics -Rghc-timing -I. -IcodeGen -InativeGen -Iparser -recomp -Rghc-timing  -H16M '-#include "hschooks.h"'    -c cmm/MachOp.hs -o stage2/cmm/MachOp.o  -ohi stage2/cmm/MachOp.hi
> /tmp/ghc32662.hc: In function `s5dU_ret':
> /tmp/ghc32662.hc:11210: Internal compiler error in `build_insn_chain', at global.c:1756

This is a known problem with gcc-2.95. 
We came across it back in September.

It was noticed in the nightly builds:
    http://www.haskell.org/pipermail/cvs-all/2004-September/035116.html

And then we chased it up:
    http://www.haskell.org/pipermail/cvs-all/2004-September/035122.html
    http://www.haskell.org/pipermail/cvs-all/2004-September/035134.html
    http://www.haskell.org/pipermail/cvs-all/2004-September/035259.html
    http://www.haskell.org/pipermail/cvs-all/2004-September/035268.html
    http://www.haskell.org/pipermail/cvs-all/2004-September/035293.html

The bug was dealt with in gcc-3.01 I think, and upgrading to gcc-3.3x
certainly stopped it occuring in the OpenBSD nightly builds.
Try adding:
    --with-gcc=gcc-3.x

Works for me. If you really need gcc-2.95, then constructing a patch
along the lines of the one proposed to solve the test case should
probably do it, though it would be a pain.

-- Don


More information about the Glasgow-haskell-users mailing list