Opened 3 years ago

Closed 3 years ago

#9282 closed bug (duplicate)

GHCi ignores .dyn_o files

Reported by: mietek Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.8.2
Keywords: dynamic linking Cc: hvr
Operating System: Unknown/Multiple Architecture: x86_64 (amd64)
Type of failure: Other Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


With both .o and .dyn_o object files available, GHCi 7.8.2 ignores the dynamic object files.

$ cat >Foo.hs <<EOF
module Foo where

foo :: IO ()
foo = print "Foo"
$ ghc -Wall -c -dynamic-too -o Foo.o Foo.hs
$ ghci
GHCi, version 7.8.2:  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
> :l Foo
[1 of 1] Compiling Foo              ( Foo.hs, interpreted )
Ok, modules loaded: Foo.

As rwbarton mentioned on IRC, the reason becomes apparent with ghci -ddump-if-trace

FYI: cannot read old interface file:
    mismatched interface file ways (wanted "dyn", got "")

This happens both on OS X and Linux.

Change History (4)

comment:1 Changed 3 years ago by mietek

Keywords: dynamic linking added

comment:2 Changed 3 years ago by rwbarton

It also ignores the .dyn_o file even if there is no .o file, with no pertinent output from -ddump-if-trace:

*** Checking old interface for main:F:
[1 of 1] Compiling F                ( F.hs, interpreted )

(I am running

comment:3 Changed 3 years ago by mietek

Summary: GHCi ignores .dyn_hi filesGHCi ignores .dyn_o files

comment:4 Changed 3 years ago by rwbarton

Resolution: duplicate
Status: newclosed

See #8736. As a workaround you can use -dynamic, not -dynamic-too. That will create dynamic-style .o and .hi files.

Note: See TracTickets for help on using tickets.