
#10726: Upgrade MingW-w64 distributions for windows -------------------------------------+------------------------------------- Reporter: Phyx- | Owner: Type: task | Status: new Priority: normal | Milestone: 7.10.3 Component: Build System | Version: 7.11 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9218 #9014 | Differential Rev(s): Phab:D1123 #10435 | Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): @lukexi thanks, can reproduce it now :) @Elieux unfortunately it seems it's not that easy. The `rts` seems to be a special case again. The linker seems to ignore the `extra-libraries` from the `package.conf`, which explains why you can put anything you want in there and it'll still compile. {{{ 128 emptyPLS :: DynFlags -> PersistentLinkerState 129 emptyPLS _ = PersistentLinkerState { 130 closure_env = emptyNameEnv, 131 itbl_env = emptyNameEnv, 132 pkgs_loaded = init_pkgs, 133 bcos_loaded = [], 134 objs_loaded = [], 135 temp_sos = [] } 136 137 -- Packages that don't need loading, because the compiler 138 -- shares them with the interpreted program. 139 -- 140 -- The linker's symbol table is populated with RTS symbols using an 141 -- explicit list. See rts/Linker.c for details. 142 where init_pkgs = [rtsUnitId] }}}
Therefore i believe proper solution should be linking `libmingwex.a`as a whole archive when building ghc.exe, instead of just letting GCC to link only used symbols as it does by default.
Hence the temporary solution. The package.conf for the `rts` ignores the `extra-libraries` section in the linker. Windows isn't alone here, Mac also re-exports some symbols. And before ripping this out I want to know why. Also I think it's riskier then just adding some extra symbols. **As** it is right now, there is no way to use `libmingwex.a` on Windows.
Reexporting those symbols seems like a bad idea, because, if I'm not mistaken, RTS gets linked into ever executable produced by GHC, so this way we are actually forcing possibly unnecessary symbols into every executable?
Yes, I don't know why it was done this way. However we are already re- exporting some of the symbols. Quite a few in fact. Yes the proper solution is to rip the symbols out and just link against `libmingwex.a` which may get in to `8.0`, but for `7.10.3` I doubt it. It's already at `RC3`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10726#comment:47 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler