[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.
Showing
- ghc/compiler/compMan/CmLink.lhs 2 additions, 1 deletionghc/compiler/compMan/CmLink.lhs
- ghc/compiler/compMan/CmTypes.lhs 15 additions, 3 deletionsghc/compiler/compMan/CmTypes.lhs
- ghc/compiler/deSugar/DsForeign.lhs 7 additions, 5 deletionsghc/compiler/deSugar/DsForeign.lhs
- ghc/compiler/ghci/ByteCodeGen.lhs 3 additions, 1 deletionghc/compiler/ghci/ByteCodeGen.lhs
- ghc/compiler/ghci/ByteCodeLink.lhs 38 additions, 13 deletionsghc/compiler/ghci/ByteCodeLink.lhs
- ghc/compiler/main/CodeOutput.lhs 1 addition, 1 deletionghc/compiler/main/CodeOutput.lhs
- ghc/compiler/main/DriverPipeline.hs 0 additions, 1 deletionghc/compiler/main/DriverPipeline.hs
- ghc/compiler/main/HscMain.lhs 7 additions, 2 deletionsghc/compiler/main/HscMain.lhs
- ghc/compiler/typecheck/TcForeign.lhs 1 addition, 1 deletionghc/compiler/typecheck/TcForeign.lhs
Loading
Please register or sign in to comment