[MacPorts] #40174: MinGW-w64: add win64 cross-compiler

MacPorts noreply at macports.org
Sun Mar 6 15:51:15 PST 2016


#40174: MinGW-w64: add win64 cross-compiler
-------------------------------------------------+-------------------------
  Reporter:  sam.halliday@…                      |      Owner:  mojca@…
      Type:  request                             |     Status:  new
  Priority:  Normal                              |  Milestone:
 Component:  ports                               |    Version:
Resolution:                                      |   Keywords:
      Port:  mingw-w64 i686-w64-mingw32-gcc      |
  x86_64-w64-mingw32-gcc                         |
-------------------------------------------------+-------------------------
Changes (by mojca@…):

 * owner:  landonf@… => mojca@…
 * cc: mojca@… (removed)
 * cc: landonf@… (added)
 * port:  i386-mingw32-gcc, mingw-w64 => mingw-w64 i686-w64-mingw32-gcc
     x86_64-w64-mingw32-gcc


Old description:

> 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:
>   *
> http://sourceforge.net/p/mingw-w64/wiki2/Cross%20Win32%20and%20Win64%20compiler/
>   * https://github.com/mirror/mingw-w64/blob/master/mingw-w64-doc/howto-
> build/mingw-w64-howto-build-adv.txt
>
> Scripts to build MinGW-w64 from scratch:
>   *
> http://cgit.notk.org/adrien/yypkg/slackware64-current.git/tree/d/binutils/binutils.SlackBuild
>   *
> http://cgit.notk.org/adrien/yypkg/slackware64-current.git/tree/d/gcc/gcc.SlackBuild
>
> Instructions about building a cross toolchain:
>   * [http://pete.akeo.ie/2010/07/compiling-mingw-w64-with-multilib-
> on.html  Compiling MinGW-w64 with multilib on Linux]
>   * [http://pmc.polytechnique.fr/pagesperso/dc/arm-en.html Design of a
> cross-toolchain "From Scratch" (for arm)]

New description:

 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:
   *
 http://sourceforge.net/p/mingw-w64/wiki2/Cross%20Win32%20and%20Win64%20compiler/
   * https://github.com/mirror/mingw-w64/blob/master/mingw-w64-doc/howto-
 build/mingw-w64-howto-build-adv.txt

 Scripts to build MinGW-w64 from scratch:
   *
 http://cgit.notk.org/adrien/yypkg/slackware64-current.git/tree/d/binutils/binutils.SlackBuild
   *
 http://cgit.notk.org/adrien/yypkg/slackware64-current.git/tree/d/gcc/gcc.SlackBuild

 Instructions about building a cross toolchain:
   * [http://pete.akeo.ie/2010/07/compiling-mingw-w64-with-multilib-on.html
 Compiling MinGW-w64 with multilib on Linux]
   * [http://pmc.polytechnique.fr/pagesperso/dc/arm-en.html Design of a
 cross-toolchain "From Scratch" (for arm)]

 Initial drafts can be found under [browser:users/mojca/ports/cross
 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?)

--

-- 
Ticket URL: <https://trac.macports.org/ticket/40174#comment:9>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list