Opened 4 years ago

Closed 4 years ago

#5313 closed bug (fixed)

wrong dylib name using GHC package

Reported by: mwotton Owned by:
Priority: high Milestone: 7.2.1
Component: GHC API Version: 7.0.3
Keywords: Cc: jcpetruzza@…
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Runtime crash Test Case: driver/5313
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

> import qualified GHC
> import qualified GHC.Paths
>
> main = GHC.runGhcT (Just GHC.Paths.libdir) $ do
>       -- begin initialize
>       df0 <- GHC.getSessionDynFlags
>       let df1 = df0{GHC.ghcMode    = GHC.CompManager,
>                     GHC.hscTarget  = GHC.HscInterpreted,
>                     GHC.ghcLink    = GHC.LinkInMemory,
>                     GHC.verbosity  = 0}
>       _ <- GHC.setSessionDynFlags df1
>       -- begin reset
>       GHC.setContext [] []
>       GHC.setTargets []
>       _ <- GHC.load GHC.LoadAllTargets
>       return ()

compiling this on ubuntu with ghc 7.0.3

$ ghc --make test.lhs -dynamic -package ghc

[1 of 1] Compiling Main             ( test.lhs, test.o )
Linking test ...
vagrant@lucid64:~$ ./test
test: <command line>: can't load .so/.DLL for: /usr/local/lib/ghc-7.0.3/ghc-prim-0.2.0.0/libHSghc-prim-0.2.0.0-ghc7.0.3.so (lib/usr/local/lib/ghc-7.0.3/ghc-prim-0.2.0.0/libHSghc-prim-0.2.0.0-ghc7.0.3.so.so: cannot open shared object file: No such file or directory)

notice the -so.so link.

Change History (5)

comment:1 Changed 4 years ago by mwotton

this is boiled down from using HINT -

import Language.Haskell.Interpreter

main = runInterpreter (return ()) >>= print

comment:2 Changed 4 years ago by simonmar

  • Milestone set to 7.2.1
  • Priority changed from normal to high

We ought to make the GHC API work with -dynamic, even if it fails horribly when some packages or modules are not compiled with -dynamic.

comment:3 Changed 4 years ago by marlowsd@…

commit aed43f7a1ed96277e9c14c6ef643eb134d5bf7f6
Author: Simon Marlow <marlowsd@…>
Date: Tue Jul 12 12:16:17 2011 +0100

Fix DLL/SO loading (see #5313).


The code in here is a bit of a mess. I've fixed up some
inconsistencies I can see, but it could do with an overhaul.

comment:4 Changed 4 years ago by simonmar

  • Status changed from new to merge
  • Test Case set to driver/5313

comment:5 Changed 4 years ago by igloo

  • Resolution set to fixed
  • Status changed from merge to closed
Note: See TracTickets for help on using tickets.