[commit: ghc] master: Document that -dynamic is needed for loading compiled code into GHCi (aeb9c93)
git at git.haskell.org
git at git.haskell.org
Mon Sep 29 13:40:32 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/aeb9c936076da2536310c5aee0234270186f54b5/ghc
>---------------------------------------------------------------
commit aeb9c936076da2536310c5aee0234270186f54b5
Author: Simon Marlow <marlowsd at gmail.com>
Date: Tue Sep 2 09:01:45 2014 +0100
Document that -dynamic is needed for loading compiled code into GHCi
>---------------------------------------------------------------
aeb9c936076da2536310c5aee0234270186f54b5
docs/users_guide/ghci.xml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/docs/users_guide/ghci.xml b/docs/users_guide/ghci.xml
index 729f96f..cbf5b76 100644
--- a/docs/users_guide/ghci.xml
+++ b/docs/users_guide/ghci.xml
@@ -226,7 +226,7 @@ Ok, modules loaded: Main.
</screen>
<para>We can compile D, then load the whole program, like this:</para>
<screen>
-Prelude> :! ghc -c D.hs
+Prelude> :! ghc -c -dynamic D.hs
Prelude> :load A
Compiling B ( B.hs, interpreted )
Compiling C ( C.hs, interpreted )
@@ -241,6 +241,11 @@ Ok, modules loaded: A, B, C, D.
because the source and everything it depends on
is unchanged since the last compilation.</para>
+ <para>Note the <literal>-dynamic</literal> flag to GHC: GHCi uses
+ dynamically-linked object code (if you are on a platform that
+ supports it), and so in order to use compiled code with GHCi it
+ must be compiled for dynamic linking.</para>
+
<para>At any time you can use the command
<literal>:show modules</literal>
to get a list of the modules currently loaded
More information about the ghc-commits
mailing list