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.

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 .)

Please also note GccVersions (you need at least gcc 4.4 to compile Wine for x86-64 because of builtin_ms_va_list support)

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 next 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 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
#make install
#cd ../wine64
#make install

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 is to first install wine32, then wine64. 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:

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:

  • Maarten's 64 bit pac-man game (File missing)
  • 7Zip - compression tool

  • Putty - remote shell client

Apps whose 32-bit versions work well with Wine:

Apps whose 32-bit versions have not yet been tested with Wine:

Apps whose 32-bit versions don't work well with Wine yet:

Known non-issues

There are some broken win64 apps out in the wild that wine does not support. Those bugs are seen here

See also

aarch64: ARM64


CategoryArchitecture

Wine64 (last edited 2013-11-11 09:53:57 by AustinEnglish)