# WINE 64bit for amd64?



## jyhpsycho (Apr 3, 2014)

Is there any way to install WINE for x64 windows applications on amd64 platform? WINE ports on ports tree requires i386, and that can run only 32-bit application.


----------



## SirDice (Apr 3, 2014)

As far as I know there are still issues with compiling a native 64 bit WINE. I'm not sure what the current status is though.


----------



## jyhpsycho (Apr 3, 2014)

I tried to compile WINE 1.7.15 from source with --enable-win64 under FreeBSD 10-STABLE. It compiles successfully with following command line:

```
# ./configure --enable-win64 CC=gcc47 CXX=g++47 LIBS=-linotify
# gmake
```
It says "WINE64 requires gcc 4.4+" when trying to compile with clang. And, without LIBS=-linotify, it says "undefined reference to inotify_xxx" during compile and it fails...

I want to put it into ports, but I don't understand how to make ports tree... :-(


----------



## SirDice (Apr 3, 2014)

I'd try and modify the original emulators/wine port. If you remove the ONLY_FOR_ARCHS= line or add "amd64" to it it should stop complaining about needing i386. Modifying an existing port is usually easier than writing one from scratch.

If you can modify the port and get it working then please create a PR and attach any patches. I'm quite sure the maintainer will appreciate it. And after some testing the changes could be released to the ports tree. Making everybody else happy too.


----------



## jyhpsycho (Apr 3, 2014)

Thanks for advice. I'll try it.


----------



## jyhpsycho (Apr 3, 2014)

I found that clang 3.4 in FreeBSD 10-STABLE can compiles WINE64 with following commands:

```
# ./configure --enable-win64 CPPFLAGS='-D__builtin_ms_va_list=__builtin_va_list -D__builtin_ms_va_start=__builtin_va_start -D__builtin_ms_va_end=__builtin_va_end'
# make
```
It seems gcc 4.4+ supports __builtin_ms_va_*, but older version of clang does not have that. According to http://marc.info/?l=cfe-commits&m=137850135703996&w=2 and http://marc.info/?l=cfe-commits&m=137877850806491&w=2, current version of clang seems to support __builtin_ms_va_* equivalent, but that's name is __builtin_va_*.

Clang does not complain about inotify functions, but it does not find some ports library gcc does - such as gstreamer, libtiff etc. I'll continue to find what's wrong later...


----------



## jyhpsycho (Apr 3, 2014)

SirDice said:
			
		

> As far as I know there are still issues with compiling a native 64 bit WINE. I'm not sure what the current status is though.


I realized what issues you say... WINE64 compiles successfully, but it throws following run-time error:

```
wine: failed to initialize: /usr/local/lib64/wine/ntdll.dll.so: mmap returned wrong address: wanted 0x7bc00000, got 0x861c00000
```
Both clang and gcc47 does.


----------



## slacka (Aug 17, 2014)

jyhpsycho's fix worked for me with Clang 3.4 to resolve





> "configure: error: "You need gcc >= 4.4 to build Wine as 64-bit."




```
# ./configure --enable-win64 CC=clang CXX=clang CPPFLAGS='-D__builtin_ms_va_list=__builtin_va_list -D__builtin_ms_va_start=__builtin_va_start -D__builtin_ms_va_end=__builtin_va_end'
# make
```


----------



## jyhpsycho (Aug 29, 2014)

WINE 1.7.25 still does not work with FreeBSD 10.1-PRERELEASE r270696 on stable svn tree. It throws following error which is different from past:


```
wine: failed to map the shared user data: c0000018
```

I don't know it is an improvement or not...


----------



## dbn@ (Feb 8, 2015)

We have managed to produce a working wine64 port.  The patches required are:

http://markmail.org/message/bzt4zuwaxp2kkqot

http://markmail.org/message/fcy4xakxir2hpn5q

http://markmail.org/message/pdhoujgle7m4drk2
We are busy working on integrating these patches into the port (emulators/wine-devel).


----------



## f-andrey (Feb 14, 2015)

I'm make test port it's build and run in FreeBSD-CURRENT-amd64.
Run winecfg (crush Audio) (need `mv /usr/local/bin/wine64 /usr/local/bin/wine`)
Unfortunately run which did not work either programs

```
wine: Bad EXE format for C:\fraqtive.exe (64-bit version)
wine: Bad EXE format for C:\fraqtive-0.4.8-win_x86.exe
```


----------



## dbn@ (Feb 14, 2015)

What does `file C:\fraqtive.exe`and `file C:\fraqtive-0.4.8-win_x86.exe` say?  Often installers for 64bit programs are 32bit themselves (and we have not developed wow64 as yet).  Try installing .msi based programs (such as 7-Zip).


----------

