[GHC] #12738: GHC drops -optl flags

GHC ghc-devs at haskell.org
Wed Oct 19 12:05:58 UTC 2016


#12738: GHC drops -optl flags
-------------------------------------+-------------------------------------
        Reporter:  niteria           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      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 Phyx-):

 Yes that function does not recognize libraries passed to the linker via
 `-optl` or `-Xlinker` flags, only `-l` and giving the archive file as a
 normal argument. This was an oversight on my part.

 The whole reason this is even needed is because of how GHC is combining
 arguments from packages and libraries and commandline
 (https://phabricator.haskell.org/diffusion/GHC/browse/master/compiler/main/SysTools.hs;02f2f21ce4a9969406cf1772dc5955a97386777a$913).
 Especially when a core package has library dependencies like base and rts.

 What it was attempting to prevent, is for symbols from libraries which the
 user didn't specify but are added due to another dependency are used
 during linking to resolve symbols instead of ones you provide in your link
 command (or vice versa). Particularly without this you would always link
 against the wrong `main` on Windows.

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


More information about the ghc-tickets mailing list