[GHC] #9524: GHC uses wrong linker when cross compiling

GHC ghc-devs at haskell.org
Mon Feb 9 15:46:20 UTC 2015


#9524: GHC uses wrong linker when cross compiling
-------------------------------------+-------------------------------------
        Reporter:  Kritzefitz        |                   Owner:  rwbarton
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Build System      |                 Version:  7.8.4
      Resolution:                    |                Keywords:  Cross
Operating System:  Linux             |  compiling
 Type of failure:  Building GHC      |            Architecture:  x86
  failed                             |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 Oh, I was going to batch this with some other hsc2hs fixes, and then I got
 sidetracked.

 I think the fix of simply removing the `#include
 "../../includes/ghcconfig.h"` is better though. #including that file in a
 Haskell program is risky business, since the `foo_HOST_OS` CPP symbol it
 defines is in the same namespace as the `bar_HOST_OS` CPP symbol that is
 automatically defined by any run of GHC. For example, in the case under
 discussion here, both `linux_HOST_OS` and `mingw_HOST_OS` are defined
 since hsc2hs is being built with the bootstrap compiler.

 There should be no need for hsc2hs to know about the eventual target
 machine type, only the machine type that it is being built to run on. Or
 in other words, it is sensible to build hsc2hs independently of the GHC
 build process. So, let's just remove that #include to ensure that we only
 get the right versions of the `foo_HOST_OS` symbols, the ones that come
 from whatever GHC is building hsc2hs, and which are correct for the
 machine hsc2hs is to run on.

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


More information about the ghc-tickets mailing list