Weird symbol prevents GHCi from loading my package.

Simon Marlow simonmar@microsoft.com
Fri, 1 Mar 2002 16:15:34 -0000


> I tried to build the head of GHC and it works fine the first=20
> time around.
> Compiling it with itself fails to build GHCi due to the new library
> system:
>=20
> /home/as49/local/bin/ghc-5.03 -DGHCI -cpp -fglasgow-exts=20
> -Rghc-timing -I.
> -IcodeGen -InativeGen -Iparser
> -iutils:basicTypes:types:hsSyn:prelude:rename:typecheck:deSuga
> r:coreSyn:specialise:simplCore:stranal:stgSyn:simplStg:codeGen
> :absCSyn:main:profiling:parser:usageSP:cprAnalysis:compMan:ndp
> Flatten:nativeGen:ghci
> -package concurrent -package posix -package util -recomp -Rghc-timing
> -H16M -O -fvia-C -monly-3-regs -c utils/PrimPacked.lhs -o
> utils/PrimPacked.o
>=20
> utils/PrimPacked.lhs:55:
>     Ambiguous occurrence `unsafePerformIO'
>     It could refer to either `PrelIOBase.unsafePerformIO',=20
> imported from
> Foreign at utils/PrimPacked.lhs:40
>                           or `GHC.IOBase.unsafePerformIO',=20
> imported from
> GlaExts at utils/PrimPacked.lhs:33

This is very odd - it looks like you've got the .hi files for two
versions of GHC mixed up somehow.  There shouldn't be a PrelIOBase at
all in the latest GHC, and yet it seems to be picking one up from
somewhere.

When doing a 2-stage bootstrap you can run the first stage directly from
the build tree without installing it - just point the second stage at
ghc/compiler/ghc-inplace in the first stage (i.e. ./configure
--with-ghc=3D/some/where/ghc/compiler/ghc-inplace).

Cheers,
	Simon