#3658: Dynamically link GHCi on platforms that support it
---------------------------------+------------------------------------------
Reporter: simonmar | Owner:
Type: task | Status: new
Priority: high | Milestone: 7.6.1
Component: GHCi | Version: 6.10.4
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking: 781
Related: |
---------------------------------+------------------------------------------
Comment(by igloo):
I think this is where we are:
* Dynamically linking GHC is relatively easy (compared to dynamically
linking executables in general). GHC already ships with the actual dynamic
libraries, so we can use assemblies on Windows, $ORIGIN on ELF and
@loader_path on OS X to find the dynlibs with a relative path.
* To load .o files in the working directory compiled by the user, ghci
can link them into a DLL in /tmp and then dlopen that DLL
* Problem 1: The .o files in the working directory would need to be built
the dyn way
* Problem 2: #5987: There are currently too many symbols to make a ghc
DLL on Windows
One solution (easy to implement, but not very user-friendly) to problem 1
would be to require that users use -dynamic when compiling things they
want ghci to be able to use.
Perhaps another would be for ghc to make both `.o` and `.dyn_o` by
default. I think the two ways are identical apart from the final codegen
phase.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3658#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs