#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 Revisions:

Description

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"
EOF
$ ghc -Wall -c -dynamic-too -o Foo.o Foo.hs
$ ghci
GHCi, version 7.8.2: http://www.haskell.org/ghc/  :? 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 13 months ago by mietek

  • Keywords dynamic linking added

comment:2 Changed 13 months 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 7.8.2.20140630.)

comment:3 Changed 13 months ago by mietek

  • Summary changed from GHCi ignores .dyn_hi files to GHCi ignores .dyn_o files

comment:4 Changed 13 months ago by rwbarton

  • Resolution set to duplicate
  • Status changed from new to closed

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.