Saturday, June 12, 2010

An evening spent cranking out Windows x64 ports & compiles

I wanted to port over some software to 64-bit Windows to see if that'd help with some performance issues: I came across the MinGW-w64 project & was able to make use of it for my purposes.


Setup


* Selective install of MinGW (GCC & Core)

* Copy of the x64 toolchain: it can be installed on top of 32-bit MinGW (you'll need some of its tools).

*Make a copy of "mingw32-make.exe" as "make.exe" for easier compiling.

JonY of MinGW-W64 recommends using MSYS. He offers the following...

mingw32-make.exe and MSYS make.exe are distinct, with the former designed to run under plain cmd and the latter under MSYS.

mingw32-make does not quite understand UNIX paths, MSYS make does not know of cmd built-in commands like del and move.

Since MSYS is for supporting mingw, mixing them together as both make.exe could get hairy with the command constantly failing mysteriously.
* It helps to have the bin folder (ex: "C:\MinGW\bin") of the combined toolchain in your PATH.

* The x64 toolchain uses filenames prefixed with "x86_64-w64-mingw32-": lengthy, but it keeps them distinct from the 32-bit toolchain and you can quickly change commands in Makefiles to reflect its usage.

* I did learn that it may be useful to copy other 64-bit .lib files as .la or .a files to the x64 toolchain's lib folder: especially since not all libraries out there "support" this version of MinGW out-of-box.

* It also helps to have a copy of Perl handy: I came across Strawberry Perl; it does run as 64-bit, as well as 32-bit, portable, etc.

Ports I compiled tonight

* Stone simple repeater: IPv6 port forwarder; original site here.
* Sloppy x64 compile of the GNU Regex library
* 64-bit version of OptiPNG: original site here.
* zlib: zlib1.dll, libz.a, and libzdll.a were all compiled successfully; original site here.


Other reference websites

* 32-bit & x64 builds of OpenSSL for Windows
* HOWTO for compiling libraries with GCC
* The cross-compiling instructions for Wormux give some useful hints. Since I play Hedgewars myself, I'll leave it to someone else to work on that. ;)

1 comment: