compiling GHC with a custom path to GCC

Remi Turk rturk at
Thu Feb 17 08:15:46 EST 2005

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

I seem to have been mistaken. When configuring with --with-gcc it
does use gcc 3.4.3. I'm letting it continue till completion to be
entirely sure. (As IIRC the compiler-errors came rather late in
the build and it's only compiling for about an hour now.)

I'll try to reproduce the 2.95 internal compiler error later.

Btw, at first I misunderstood the following comment in
docs/building/building.xml to mean that --with-gcc only specified
the compiler for actual .c files in the ghc-distribution. (Which
explains my "(okay, for --with-gcc that's documented)")

	  <para>Specifies the path to the installed GCC. This
	  compiler will be used to compile all C files,
	  <emphasis>except</emphasis> any generated by the
	  installed Haskell compiler, which will have its own
	  idea of which C compiler (if any) to use.  The
	  default is to use <literal>gcc</literal>.</para>

To be more precisely, to me "the installed Haskell compiler" was
"the (stage[12] of the) Haskell compiler to be installed once
it's compiled".


Nobody can be exactly like me. Even I have trouble doing it.

More information about the Glasgow-haskell-users mailing list