[GHC] #13431: Linker error related to atan and ntdll on 32-bit Windows

GHC ghc-devs at haskell.org
Mon Mar 20 11:37:41 UTC 2017


#13431: Linker error related to atan and ntdll on 32-bit Windows
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  Phyx-
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler          |              Version:  8.0.1
      Resolution:  wontfix           |             Keywords:
Operating System:  Windows           |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by Phyx-):

 * status:  upstream => closed
 * resolution:   => wontfix
 * architecture:  x86 => Unknown/Multiple


Comment:

 Well, the long story short is this won't get fixed.

 The issue is that `mingw-w64` have their own version of the math
 functions. So depending on the link order you specify you get either the
 weird one exported in `ntdll` (which honestly I think is a mistake that
 Microsoft never could correct due to backwards compatibility.)

 Anyway, we debated three options, one of which I proposed was to remove
 these functions from `ntdll.a` entirely as MSDN does not document them.
 This lends more evidence to my theory that they were a mistake.

 But it seems this can't be done, so instead I suggested to also change the
 x64 version to break. The reason is that at least it's consistent and you
 won't end up with a different math function by accident.

 On the long term, this means that no haskell library should use `ntdll.a`
 as libraries don't have full control over the link ordering.

 This of course extends to other C code compiled by GHC. Those have to be
 linked to a shared library and then used by haskell code or dynamically
 load ntdll. Such is life.

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


More information about the ghc-tickets mailing list