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:
- 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:
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
- dependencies:
- {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)
- same sources as the gcc compiler; only a different target (
- pthreads-win32
- dependencies:
- {i686,x86_64}-w64-mingw32-libgcc (or full compiler)
- dependencies:
- {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
- same sources as the gcc compiler; only a different target (
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@…
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: | update → enhancement |
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:6 Changed 10 years ago by mojca (Mojca Miklavec)
Description: | modified (diff) |
---|---|
Port: | mingw-w64 added |
Summary: | upgrade mingw and add win64 cross-compiler → MinGW-w64: add win64 cross-compiler |
Type: | enhancement → request |
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: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 |
this should be against i386-mingw32-gcc (but I can't seem to change that anymore)