[GHC] #13845: Runtime linker too eagerly checks for symbol names

GHC ghc-devs at haskell.org
Mon Jun 19 16:29:29 UTC 2017


#13845: Runtime linker too eagerly checks for symbol names
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Runtime System    |              Version:  8.0.1
  (Linker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 As Phyx- notes, this is actually somewhat expected behavior. The reason
 this happens in `runghc` and not with compiled code is because interpreted
 mode loads //all// top-level definitions (even those that are not
 exported). This is a handy feature to have when tinkering around with code
 in GHCi, but it does mean that you'll need to load all the symbols being
 used, which results in the linker error.

 A "workaround" is to use `runghc` with the `-fobject-code` flag, i.e.,
 `runghc --ghc-arg=-fobject-code Bug.hs`. Of course, this somewhat defeats
 the purpose of using `runghc` in the first place, but thems the breaks.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13845#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list