[commit: ghc] master: Add back a comment that got lost (c0f89a1)

git at git.haskell.org git
Tue Oct 1 10:48:59 UTC 2013


Repository : ssh://git at git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c0f89a1b536d9cd3640803138d5f794982049cce/ghc

>---------------------------------------------------------------

commit c0f89a1b536d9cd3640803138d5f794982049cce
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Thu Sep 26 17:10:26 2013 +0100

    Add back a comment that got lost


>---------------------------------------------------------------

c0f89a1b536d9cd3640803138d5f794982049cce
 compiler/main/DynFlags.hs |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 071c16c..918b1ae 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1123,6 +1123,13 @@ wayGeneralFlags _ (WayCustom {}) = []
 wayGeneralFlags _ WayThreaded = []
 wayGeneralFlags _ WayDebug    = []
 wayGeneralFlags _ WayDyn      = [Opt_PIC]
+    -- We could get away without adding -fPIC when compiling the
+    -- modules of a program that is to be linked with -dynamic; the
+    -- program itself does not need to be position-independet, only
+    -- the libraries need to be.  HOWEVER, GHCi links objects into a
+    -- .so before loading the .so using the system linker.  Since only
+    -- PIC objects can be linked into a .so, we have to compile even
+    -- modules of the main program with -fPIC when using -dynamic.
 wayGeneralFlags _ WayProf     = [Opt_SccProfilingOn]
 wayGeneralFlags _ WayEventLog = []
 wayGeneralFlags _ WayPar      = [Opt_Parallel]




More information about the ghc-commits mailing list