Opened 11 years ago

Last modified 8 years ago

#40174 closed request

MinGW-w64: add win64 cross-compiler — at Version 9

Reported by: sam.halliday@… Owned by: mojca@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: landonf@…, hippallium-macports@…
Port: mingw-w64 i686-w64-mingw32-gcc x86_64-w64-mingw32-gcc

Description (last modified by mojca (Mojca Miklavec))

the MingW cross-compiler for windows is quite old and there is currently no cross-compiler for Windows 64. Packages for both would be fantastic!

http://mingw-w64.sourceforge.net/

Upstream build instructions:

Scripts to build MinGW-w64 from scratch:

Instructions about building a cross toolchain:

Initial drafts can be found under users/mojca/ports/cross).

Ports

The ports have to be compiled in the following order:

  • {i686,x86_64}-w64-mingw32-binutils (DONE)
    • (no dependencies)
  • {i686,x86_64}-w64-mingw32-headers (DONE)
    • (no dependencies)
  • gmp, mpfr, libmpc (native ports already packaged by MacPorts)
  • cloog, ppl (might be worth looking into)
  • {i686,x86_64}-w64-mingw32-gcc (possibly rename)
    • gcc compiler
    • dependencies:
      • {i686,x86_64}-w64-mingw32-binutils
      • {i686,x86_64}-w64-mingw32-headers
      • {i686,x86_64}-w64-mingw32-gcc
      • gmp, mpfr, libmpc
      • libiconv, zlib
    • the first stage compiles (this is a standalone gcc, it won't actually be able to link executables, but it is already suitable to compile the CRT)
  • {i686,x86_64}-w64-mingw32-crt (DONE)
    • dependencies:
      • {i686,x86_64}-w64-mingw32-binutils
      • {i686,x86_64}-w64-mingw32-headers
      • {i686,x86_64}-w64-mingw32-gcc (either first stage or any later stage)
    • make sure that all the file are where expected
  • {i686,x86_64}-w64-mingw32-libgcc
    • same sources as the gcc compiler; only a different target (make all-target-libgcc && make install-target-libgcc)
    • when a compiler already exists, one could build both gcc and libgcc at the same time
    • files provided by the gcc port should be removed
    • dependencies:
      • {i686,x86_64}-w64-mingw32-crt
      • {i686,x86_64}-w64-mingw32-gcc (either first stage or any later stage)
  • pthreads-win32
    • dependencies:
      • {i686,x86_64}-w64-mingw32-libgcc (or full compiler)
  • {i686,x86_64}-w64-mingw32-all(?) (second stage of gcc compiler)
    • same sources as the gcc compiler; only a different target (make && make install)
    • dependencies:
      • pthreads-win32
      • {i686,x86_64}-w64-mingw32-libgcc

Things to do

  • fix layout of individual packages (folders where files are installed)

Further challenges

  • on top of C and C++ also support Ada, Fortran, ObjC, ObjC++ (--enable-languages=c,c++,objc,obj-c++,ada,fortran)
  • support clang
  • figure out where stdlibc++ should be located on Windows (is it possible to build it statically?)

Change History (9)

comment:1 Changed 11 years ago by sam.halliday@…

this should be against i386-mingw32-gcc (but I can't seem to change that anymore)

comment:2 Changed 11 years ago by cooljeanius (Eric Gallager)

As far as the "being quite old" part, that's #31578... as for the x86_64 support part, I think I've seen a ticket for that, too, but I'm still looking for that...

comment:3 Changed 11 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to landonf@…
Port: i386-mingw32-gcc added
Type: updateenhancement
Version: 2.2.0

in the future, please Cc the port maintainers (port info --maintainers).

comment:4 Changed 11 years ago by sam.halliday@…

workaround is to download the mingw64 binaries for i686-darwin from sourceforge.

comment:5 Changed 10 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added

Cc Me!

comment:6 Changed 10 years ago by mojca (Mojca Miklavec)

Description: modified (diff)
Port: mingw-w64 added
Summary: upgrade mingw and add win64 cross-compilerMinGW-w64: add win64 cross-compiler
Type: enhancementrequest

comment:7 Changed 10 years ago by mojca (Mojca Miklavec)

I started playing with mingw-w64 (you can check users/mojca/ports/cross), but these are still very basic attempts to get something working. I'm still learning.

comment:8 Changed 10 years ago by hippallium-macports@…

Cc: hippallium-macports@… added

Cc Me!

comment:9 Changed 9 years ago by mojca (Mojca Miklavec)

Cc: landonf@… added; mojca@… removed
Description: modified (diff)
Owner: changed from landonf@… to mojca@…
Port: i686-w64-mingw32-gcc x86_64-w64-mingw32-gcc added; i386-mingw32-gcc removed
Note: See TracTickets for help on using tickets.