Win64 Support for Wine
This page is for notes on the 64-bit port of Wine for AMD64 (a.k.a. x64 or x86-64) and its wow64 setup.
For normal use (if you have a 64-bit operating system), you will want to compile the wow64 setup of Wine.
If you are a Wine packager please see the Wine64ForPackagers page.
Using an up-to-date gcc
GCC 4.4 is affected by the gcc64 float bug, so compiling with it will result in some broken code. GCC 4.5.1 should compile Wine correctly. You may need to compile GCC from source, if it is not yet available via your package manager.
Use the following shell script to download and compile GCC Subversion: http://winezeug.googlecode.com/svn/trunk/gcc64.sh (but read it first!). This will build the appropriate GCC and install it into /usr/local/gcc.
Installing build prerequisites
Install the needed development packages as described in WineOn64bit. (Hint: run wget http://winezeug.googlecode.com/svn/trunk/install-wine-deps.sh .)
Configuring for 64-bit compilation
The basic way to configure Wine for 64-bit compilation is:
./configure --enable-win64
This will use the default GCC. To use a different version of GCC, run:
./configure --enable-win64 CC=/path/to/subversion-gcc/bin/gcc
For example, if you compiled gcc as above:
./configure --enable-win64 CC=/usr/local/gcc/bin/gcc
You can then do 'make' as usual.
Building a shared WoW64 setup (most likely what you want)
The previous paragraph explains how to build completely separate 32- and 64-bit trees. A more useful setup is to build a shared Wow64 installation, which allows 32-bit programs to invoke 64-bit ones and the other way around.
This again requires an out-of-tree build, with two separate build trees:
cd $HOME mkdir wine64 cd wine64 ../wine-git/configure --enable-win64 CC=/usr/local/gcc/bin/gcc make > make.log 2>&1 cd .. mkdir wine32 cd wine32 ../wine-git/configure --with-wine64=../wine64 make > make.log 2>&1
Note that arguments are --enable-win64 and --with-wine64, not --enable-wine64 and --with-win64.
Now you should run wine in the wine64 directory to have the Wow64 Features. Make sure you always compile wine64 first to have the tools needed for wine32, the order of installing them is nonrelevant. The 32-bit side of such a Wow64 build is in theory supposed to work identically to a stand-alone 32-bit build. Currently this is not quite the case, any help is welcome...
Building both 32- and 64-bit Wine from the same source tree
It's useful to build and test the same sources for both 32- and 64-bits. To do that, use out-of-tree builds, e.g.
cd $HOME mkdir wine64 cd wine64 ../wine-git/configure --enable-win64 CC=/usr/local/gcc/bin/gcc make > make.log 2>&1 make -k test > test.log 2>&1 cd .. mkdir wine32 cd wine32 ../wine-git/configure make > make.log 2>&1 make -k test > test.log 2>&1
You can then compare the compilation warnings and test failures of the 32- and 64-bit builds, e.g. with this shell-script:
for dir in wine32 wine64
do
echo $dir
cd $dir
echo -n "ok: "; find . -name '*.ok' | wc -l
echo -n "err: "; grep ok.*Error test.log | wc -l
cd ..
done
Current problems
There are still some pointer to int32 casts that need to be fixed. Most of these issue an appropriate warning.
The x86_64 ABI differs between Linux and Windows. One of the major differences is the size of the "long" type, which is 64 bits in Linux but 32 bits in Windows. Also the function calling convention differs. In both ABIs, parameters are preferably passed via registers, but the registers used differ. More on the Linux ABI can be found here, while information on the Windows ABI can be found here (hope this link survives in the future; if it doesn't, just search for "x64 Software Conventions" on MSDN).
Porting guides
There are a number of guides explaining how to make Windows code portable between 32- and 64-bits, for instance:
http://software.intel.com/en-us/articles/preparing-code-for-the-intel-ia-64-architecture-code-clean/
Programming Guide for 64-bit Windows http://msdn.microsoft.com/en-us/library/bb427430%28VS.85%29.aspx
Why did the Win64 team choose the LLP64 model? http://blogs.msdn.com/oldnewthing/archive/2005/01/31/363790.aspx
Compilers
Here are some Windows compilers that run in win32 and generate win64 executables:
Known Win64 apps
http://www.start64.com is kind of messy, but it does list a lot of Win64 software.
Here are a few that have free downloads and look like they might be useful test cases. The list is split based on whether the 32-bit version of the app has been tested with Wine.
Apps whose 64-bit versions work with Wine64:
Apps whose 32-bit versions work well with Wine:
PDF-Xchange - PDF viewer
Mozilla apps - Yes, firefox, thunderbird, and all your friends have unofficial 64 bit versions!
Python - the language
Apps whose 32-bit versions have not yet been tested with Wine:
City Engine - cad tool for urban planners
EmEditor - text editor
GPUViewer - Photo viewer
ImageMagick - image manipulation tools
Lazarus - IDE for Free Pascal
VariCad - 2d/3d CAD program
Apps whose 32-bit versions don't work well with Wine yet:
Adobe Lightroom 2.2 - photo viewer / manipulator
SiSoft Sandra - benchmark tool
