summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2013-09-26 17:10:26 +0100
committerSimon Marlow <marlowsd@gmail.com>2013-10-01 11:45:46 +0100
commitc0f89a1b536d9cd3640803138d5f794982049cce (patch)
treee673be325bdf05948fd051ee3c676ce7ce489af9
parent2798a174296c4bc7c74b352fdcb1c775bdfc6496 (diff)
downloadhaskell-c0f89a1b536d9cd3640803138d5f794982049cce.tar.gz
Add back a comment that got lost
-rw-r--r--compiler/main/DynFlags.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 071c16ca80..918b1ae022 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]