summaryrefslogtreecommitdiff
path: root/compiler/ghci/Linker.lhs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-09-20 18:10:32 +0000
committerIan Lynagh <igloo@earth.li>2010-09-20 18:10:32 +0000
commit295e7569c4793d210afbd05b42c81571b170baa9 (patch)
treeb3222c2d439016b1cc9a0a13ac5825950ab93d95 /compiler/ghci/Linker.lhs
parenta02dc8731ee2c3fe0ae6aee7a8c957881a875279 (diff)
downloadhaskell-295e7569c4793d210afbd05b42c81571b170baa9.tar.gz
Filter out the FFI library when loading package in ghci
The FFI GHCi import lib isn't needed as compiler/ghci/Linker.lhs + rts/Linker.c link the interpreted references to FFI to the compiled FFI. We therefore filter it out so that we don't get duplicate symbol errors.
Diffstat (limited to 'compiler/ghci/Linker.lhs')
-rw-r--r--compiler/ghci/Linker.lhs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs
index 66a4576171..9fc22dfbf1 100644
--- a/compiler/ghci/Linker.lhs
+++ b/compiler/ghci/Linker.lhs
@@ -1017,6 +1017,12 @@ linkPackage dflags pkg
let dirs = Packages.libraryDirs pkg
let libs = Packages.hsLibraries pkg
+ -- The FFI GHCi import lib isn't needed as
+ -- compiler/ghci/Linker.lhs + rts/Linker.c link the
+ -- interpreted references to FFI to the compiled FFI.
+ -- We therefore filter it out so that we don't get
+ -- duplicate symbol errors.
+ libs' = filter ("HSffi" /=) libs
-- Because of slight differences between the GHC dynamic linker and
-- the native system linker some packages have to link with a
-- different list of libraries when using GHCi. Examples include: libs
@@ -1028,7 +1034,7 @@ linkPackage dflags pkg
then Packages.extraLibraries pkg
else Packages.extraGHCiLibraries pkg)
++ [ lib | '-':'l':lib <- Packages.ldOptions pkg ]
- classifieds <- mapM (locateOneObj dirs) libs
+ classifieds <- mapM (locateOneObj dirs) libs'
-- Complication: all the .so's must be loaded before any of the .o's.
let dlls = [ dll | DLL dll <- classifieds ]