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). This port is just beginning to work, but is not yet fully functional. Only people who are planning to fix the code will want to compile Wine like this.
If you have a 64-bit operating system, and want to compile the 32-bit Wine (to run normal 32-bit Windows programs), see the WineOn64bit page.
Using an up-to-date gcc
GCC 4.4 has been released, which can compile 64-bit 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 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
(Until winedbg has been ported to 64-bits, any program that crashes may hang. To work around this, either 1) kill any test that hangs, or 2) run the tests with WINETESTWRAPPER set to a wrapper like http://code.google.com/p/winezeug/source/browse/trunk/patchwatcher/alarm.c?r=226 )
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
As of Jan 5th, this outputs:
wine32 ok: 378 err: 11 wine64 ok: 282 err: 107
so we're already passing 2/3 of the tests... not bad for starters.
Current problems
There are many, many pointer to int32 casts that need to be fixed. (About 3000.) Most of these issue an appropriate warning.
CPU-specific code that needs to be completed:
dlls/dbghelp/minidump.c programs/winedbg/gdbproxy.c programs/winedbg/winedbg.c
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/
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 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
7Zip - compression tool
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
