
#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/Sy...). 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