[project @ 2002-02-18 12:41:01 by sewardj]
authorsewardj <unknown>
Mon, 18 Feb 2002 12:41:03 +0000 (12:41 +0000)
committersewardj <unknown>
Mon, 18 Feb 2002 12:41:03 +0000 (12:41 +0000)
commit45ddebc0dc20f013eff011a157b42acb37ea7598
treea15b1ebb807e6d316f5b4719b0263d470a3192de
parent94667d2af5bb451c8f344ea941d3ab9c3d648499
[project @ 2002-02-18 12:41:01 by sewardj]
Make foreign export dynamic work in GHCi.  Main changes:

* Allow literal labels to propagate through the bytecode generator
  and eventually be linked by the runtime linker.

* Minor mods to driver plumbing so that GHCi produces the relevant
  *_stub.[ch] files, compiles them with gcc, and loads the resulting .o's

* Dereference the stable pointer in the generated C stub, rather
  than passing it to a Haskell-world helper.  This seems simpler and
  removes the need to have a H-world helper, which in turn means the
  stub .o doesn't refer to any H-world entities.  This is important
  because our linker can't deal with mutual recursion between
  BCOs and loaded objects.

Still ToDo:

* Make it thread/GC safe.  (Sigbjorn?)

* Get rid of the bits of code in DsForeign which generate the
  Haskell helper.  I had a go but it wasn't obvious how to do it,
  so have deferred.
ghc/compiler/compMan/CmLink.lhs
ghc/compiler/compMan/CmTypes.lhs
ghc/compiler/deSugar/DsForeign.lhs
ghc/compiler/ghci/ByteCodeGen.lhs
ghc/compiler/ghci/ByteCodeLink.lhs
ghc/compiler/main/CodeOutput.lhs
ghc/compiler/main/DriverPipeline.hs
ghc/compiler/main/HscMain.lhs
ghc/compiler/typecheck/TcForeign.lhs