Opened 2 months ago

Last modified 6 days ago

#8736 new bug

GHCi doesn't load .dyn_o files appropriately

Reported by: thoughtpolice Owned by: thoughtpolice
Priority: high Milestone: 7.8.3
Component: Compiler Version: 7.8.1-rc2
Keywords: Cc: george.colpitts@…, lukexi@…, gideon@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Now that GHCi generally defaults to dynamic linking, it handles dynamic object files. But it doesn't implicitly handle the -dynamic-too case appropriately:

$ cat Test.hs
main = return ()

$ ./inplace/bin/ghc-stage2 -dynamic Test.hs
[1 of 1] Compiling Main             ( Test.hs, Test.o )
Linking Test ...

$ ./inplace/bin/ghc-stage2 --interactive Test
GHCi, version 7.8.20140130: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Ok, modules loaded: Main.
Prelude Main> ^D

$ ./inplace/bin/ghc-stage2 -dynamic-too Test.hs
[1 of 1] Compiling Main             ( Test.hs, Test.o )
Linking Test ...

$ ./inplace/bin/ghc-stage2 --interactive Test
GHCi, version 7.8.20140130: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main             ( Test.hs, interpreted )
Ok, modules loaded: Main.
*Main> 

Also:

$ ./inplace/bin/ghc-stage2 --interactive Test.dyn_o
GHCi, version 7.8.20140130: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Warning: ignoring unrecognised input `Test.dyn_o'
Prelude> 

but it does handle the .o case. This should all be fixed and merged to 7.8 since it'll likely be very annoying.

Change History (8)

comment:1 Changed 2 months ago by George

  • Cc george.colpitts@… added

comment:2 Changed 8 weeks ago by lukexi

  • Cc lukexi@… added

comment:3 Changed 7 weeks ago by thoughtpolice

Ugh, so this is a slightly annoying 'fix' because the compilation options are hashed as part of the recompilation check, and simply loading the dynamic interface file won't work as the hashes will differ (because -dynamic-too implies some other options). I've almost got a working fix for this I think, but it's unclear to me how hacky it might be.

comment:4 Changed 7 weeks ago by simonpj

Summarising the behaviour. If you say :load Foo in GHCi

  • Foo was compiled with -dynamic: loads Foo.o
  • Foo was compiled without any dynamic flag: does not find object files, so interprets.
  • Foo was compiled with -dynamic-too: fails as above.

Not a release blocker.

Last edited 4 weeks ago by simonmar (previous) (diff)

comment:5 Changed 5 weeks ago by thoughtpolice

  • Version changed from 7.8.1-rc1 to 7.8.1-rc2

comment:6 Changed 3 weeks ago by thoughtpolice

  • Milestone changed from 7.8.1 to 7.8.2

We're moving this to 7.8.2.

comment:7 Changed 3 weeks ago by gidyn

  • Cc gideon@… added

comment:8 Changed 6 days ago by thoughtpolice

  • Milestone changed from 7.8.2 to 7.8.3
Note: See TracTickets for help on using tickets.