Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#10066 closed bug (duplicate)

Cross compiling from Linux to Windows fails

Reported by: erikd Owned by: erikd
Priority: normal Milestone: 8.0.1
Component: Compiler Version: 7.10.1-rc2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Building from git HEAD (daed18c35cda1) and configuring with:

./configure --target=i686-w64-mingw32

The build then fails with:

utils/hsc2hs/dist/build/Main.o: In function `c4tf_info':
(.text+0x80a): undefined reference to `GetModuleFileNameW'

but earlier on there was other suspicious output like:

utils/hsc2hs/Main.hs:234:1: Warning:
    the 'stdcall' calling convention is unsupported on this platform,
    treating as ccall
    When checking declaration:
      foreign import stdcall unsafe "static windows.h
        GetModuleFileNameW" c_GetModuleFileName
        :: Ptr () -> CWString -> Word32 -> IO Word32

which suggests that the cross tool chain is not being used. However, the configure process did indeed find the right cross compilers and linkers. From the configure output:

   Building GHC version  : 7.11.20150204
          Git commit id  : daed18c35cda114d8a5303bcb645195e1fd397e3

   Build platform        : x86_64-unknown-linux
   Host platform         : x86_64-unknown-linux
   Target platform       : i386-unknown-mingw32

   Bootstrapping using   : /usr/bin/ghc
      which is version   : 7.8.3

   Using gcc                 : /usr/bin/i686-w64-mingw32-gcc
      which is version       : 4.9.2
   Building a cross compiler : YES
   cpp       : /usr/bin/i686-w64-mingw32-gcc
   cpp-flags : -E -undef -traditional 
   ld        : /usr/bin/i686-w64-mingw32-ld

Change History (4)

comment:1 Changed 5 years ago by erikd

Owner: set to erikd

comment:2 Changed 5 years ago by rwbarton

Duplicate of #9524 yes?

comment:3 Changed 5 years ago by erikd

Resolution: duplicate
Status: newclosed

Yes, closing this as a dupe of #9524.

comment:4 Changed 4 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

Note: See TracTickets for help on using tickets.