adding new primitives to ghci...

Simon Marlow simonmar@microsoft.com
Wed, 20 Nov 2002 12:30:30 -0000


> 	I am trying to add a new primitive to ghc (5.04.1) ...=20
> I followed=20
> the instructions in primops.txt.pp:=20
>=20
> -- 	- or, for an out-of-line primop:
> --              ghc/includes/PrimOps.h (just add the declaration) =20
> --              ghc/rts/PrimOps.hc     (define it here)
> --              ghc/rts/Linker.c       (declare the symbol for GHCi)
> --=20
> =20
> 	My new primitive works fine when I compile the programs that=20
> use it but when I try to load ghci I get:
>=20
> lxdsg[137](2.05)> ./ghc-inplace --interactive
>    ___         ___ _
>   / _ \ /\  /\/ __(_)
>  / /_\// /_/ / /  | |      GHC Interactive, version 5.04.1,=20
> for Haskell=20
> 98.
> / /_\\/ __  / /___| |      http://www.haskell.org/ghc/
> \____/\/ /_/\____/|_|      Type :? for help.
>=20
> Loading package base ... linking ...=20
> /data/dubois/ghc-5.04.1/libraries/base/HSbase.o: unknown symbol=20
> `packcczh_fast'
> ghc-5.04.1: panic! (the `impossible' happened, GHC version 5.04.1):
>         can't load package `base'
>=20
> Please report it as a compiler bug to=20
> glasgow-haskell-bugs@haskell.org,
> or http://sourceforge.net/projects/ghc/.

You need to bootstrap GHCi with the compiler that contains the new
primitive.

Cheers,
	Simon