[GHC] #9938: GHC's link step needs to be told which packages to link (was: cryptarithm2 fails with undefined reference to `transzuH9c1w14lEUN3zzdWCTsn8jG_ControlziMonadziTransziStateziLazzy_zdwzdcp0Alternative_info')

GHC ghc-devs at haskell.org
Tue Dec 30 11:44:22 UTC 2014


#9938: GHC's link step needs to be told which packages to link
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.11
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash                              |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Replying to [comment:4 nomeata]:
 >  I hope that successful linking should not depend on the particular
 optimizations that went through.

 I'm afraid I suspect it does!

  * When compiling a source module, GHC can find imports from any exposed
 packages, in this case `transformers`.

  * But when linking `.o` files, GHC doesn't know which packages to link.
 So you mus specify on the command line; e.g. `-package transformers`.

  * If you inline enough things so that there are no remaining references
 to things from a package, then you don't need to include that package in
 the link command. This is pretty unusual.

 The Right Thing is, I guess, when given a `.o` file on the command line,
 to read its interface file, to find what packages it needs, and include
 those in any link step.

 Patch welcome!

 Simon

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


More information about the ghc-tickets mailing list