Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CodeWeavers CrossOver - How to compile from source! for macOS

[STOP] This gist is deprecated.

TL;DR

Instructions for Building CrossOver v20: https://gist.github.com/sarimarton/471e9ff8046cc746f6ecb8340f942647.
Current Development for Building Libre-version of CrossOver: https://github.com/GabLeRoux/macos-crossover-cloud-build.
For Latest Discussions: https://github.com/GabLeRoux/macos-crossover-cloud-build/issues.

Long Description

This version of gist is outdated since it was written while I was compiling CrossOver v19. and seems to be there are some breaking changes in v19.1+ and 20. Also, I think I missed some required libraries that was required in build (that I previously installed beforehand). Oops.

Please use the gist linked above for more information.

If you need compiled binary, @GabLeRoux did a fabulous job on building CD for Libre version of CrossOver using GitHub Actions at this repo.

This document will be stay here for archival purpose. Thanks for the updates! :D.

How to compile codeweavers crossover from source

If you have some money, try supporting wine development by supporting Crossover. (I did it)
They claim that they support the WineHQ project, and they seems to support the upstream WineGitRepoSearch

Installing Dependencies

To install, you need following dependencies to be installed on your Mac machine.

  • Xcode developer tools (Command Line)
  • cmake
  • gcc or clang to compile c codes.
  • bison >= 3.0 (can be upgraded via homebrew)
  • xquartz
  • flex
  • mingw-w64
  • pkgconfig

(If more dependencies are found, the list will be updated)

Getting the Source

Go to CodeWeavers CrossOver FOSS version Source and download the source.

This guide is strictly for Compiling on Mac. use command tar -xz whatever_the_filename_is.tar.gz to untar it.

Compiling LLVM

Go to llvm directory and create build directory with command mkdir build.

cd build to go there and run cmake ../ to configure build directory.
When cmake is done, you can run make to compile.
This will take a long time... Take your time and have a break.
(Build Time: 1h 25m 45s on 2018 Macbook Pro with intel Core i9 Processor)
now cd bin and add binaries to PATH via export PATH="$(pwd):$PATH".

Compiling Clang

Go to clang directory and create build directory with command mkdir build. (PATH setup from llvm required!!)

cd build to go there and run cmake ../ to configure build directory.
When cmake is done, you can run make to compile.
This will take some time... Take your time and have a break.
(Build Time: 34m 36s on 2018 Macbook Pro with intel Core i9 Processor)
now cd bin and add binaries to PATH via export PATH="$(pwd):$PATH".

Compiling Wine

The custom build of wine by codeweavers have special flag called --enable-win32on64.
Use that to when you setup with ./configure.

Use command CC="clang" CXX="clang++" ./configure --enable-win32on64
Then compile with make

@sarimarton

This comment has been minimized.

Copy link

@sarimarton sarimarton commented Mar 7, 2020

You're a hero.

@sarimarton

This comment has been minimized.

Copy link

@sarimarton sarimarton commented Mar 8, 2020

Hi,

thanks for this awesome guide. I have a couple of notes and an issue.

  • bison >= 3.0 (can be upgraded via homebrew) - it would be worth mentioning that after installing a newer version via brew doesn't switch the default one to that newer version automatically. An additional command is needed for the system to see the newer one: export PATH=/usr/local/Cellar/bison/<version>/bin:$PATH
  • Compiling Wine: I know it sounds obvious, but to match with the general foolproof level of the guide, it could be mentioned to cd /wine before using the wine compile commands.
  • Currently my build stops with this stdout tail:
programs/winedbg/resource.h:23: error: distversion.h: No such file or directory
programs/winedbg/crashdlg.c:31: note: resource.h was first included here
config.status: error: could not create Makefile
@sarimarton

This comment has been minimized.

Copy link

@sarimarton sarimarton commented Mar 8, 2020

Unfortunately if I take out the import distversion.h from resource.h, after that, the build stops with this error:

clang -mwine32 -mstorage-address-space=default -minterop64-32-thunk-prefix=wine -minterop64-32-cs32-name=wine_32on64_cs32 -minterop64-32-cs64-name=wine_32on64_cs64 -mstack64 -mdefault-address-space=ptr32 -mstorage-address-space=ptr32 -mno-stack64 -c -o icc.o icc.c \
  -ilocal . -ilocal ../../include -I/usr/local/Cellar/little-cms2/2.9/include -D__WINESRC__ \
  -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body \
  -Wignored-qualifiers -Wno-pragma-pack -Wstrict-prototypes -Wtype-limits -Wvla -Wwrite-strings \
  -Wpointer-arith -gdwarf-2 -gstrict-dwarf -Werror=extra-tokens \
  -Werror=implicit-function-declaration -Werror=incompatible-function-pointer-types \
  -Werror=incompatible-pointer-types-discards-qualifiers -Werror=incompatible-pointer-types \
  -Werror=pointer-to-int-cast-truncates -Werror=pointer-to-int-cast \
  -Werror=int-to-pointer-cast-truncates -Werror=out-of-scope-function -Werror=pointer-arith \
  -Werror=pointer-type-mismatch -Werror=strict-prototypes \
  -Werror=tautological-constant-out-of-range-compare -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
icc.c:82:34: error: passing 'unsigned int *' to parameter of type '__storage32 ULONG *' (aka '__storage32 unsigned int *') changes address space of pointer
            adjust_endianness32( &tag->offset );
                                 ^~~~~~~~~~~~
icc.c:36:48: note: passing argument to parameter 'ptr' here
static inline void adjust_endianness32( ULONG *ptr )
                                               ^
icc.c:83:34: error: passing 'unsigned int *' to parameter of type '__storage32 ULONG *' (aka '__storage32 unsigned int *') changes address space of pointer
            adjust_endianness32( &tag->size );
                                 ^~~~~~~~~~
icc.c:36:48: note: passing argument to parameter 'ptr' here
static inline void adjust_endianness32( ULONG *ptr )
                                               ^
2 errors generated.
make[1]: *** [icc.o] Error 1
make: *** [dlls/mscms] Error 2

Have you managed to finish the compile?

@tellowkrinkle

This comment has been minimized.

Copy link

@tellowkrinkle tellowkrinkle commented Apr 5, 2020

Have you managed to finish the compile?

A bunch of the modules don't build, just disable them (IIRC I ended up using --disable-winedbg --without-x --without-vulkan --disable-mscms)

@ryandesign

This comment has been minimized.

Copy link

@ryandesign ryandesign commented May 2, 2020

programs/winedbg/resource.h:23: error: distversion.h: No such file or directory

@sarimarton I'm the maintainer of wine in MacPorts. I reported the missing distversion.h to CodeWeavers back in 2013 and reminded them of it in 2018. I guess they're never going to add it. But they provided its contents to me; it's here, in patch form:

https://github.com/macports/macports-ports/blob/master/x11/wine-crossover/files/patch-include-distversion.h.diff

@sarimarton

This comment has been minimized.

Copy link

@sarimarton sarimarton commented May 4, 2020

@tellowkrinkle, @ryandesign Thanks very much, with using both of yours suggestions, it compiled.

Unfortunately I can't make it work. According to the README I should be able to do a simple ./wine notepad, but...

~/Downloads/sources/wine$ ./wine notepad
wine: could not find the Wine loader in /Users/sarimarton/Downloads/sources/wine

If I use win32on64 I get a long list of address is outside of segment errors:

~/Downloads/sources/wine$ ./wine32on64 notepad                                                         
000b:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x68618E0C is outside of segment __DATA_CONST (0x6858C000 -> 0x6858D000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
000b:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\wineboot.exe") failed (error c000007a).
000b:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
000b:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\wineboot.exe") failed (error c000007a).
000b:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
000b:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\wineboot.exe") failed (error c000007a).
000b:err:module:LdrInitializeThunk Importing dlls for L"C:\\windows\\system32\\wineboot.exe" failed, status c0000135
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x68618E0C is outside of segment __DATA_CONST (0x6858C000 -> 0x6858D000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\notepad.exe") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x68618E0C is outside of segment __DATA_CONST (0x6858C000 -> 0x6858D000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\comdlg32.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x68618E0C is outside of segment __DATA_CONST (0x6858C000 -> 0x6858D000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\comctl32.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x687E2E0C is outside of segment __DATA_CONST (0x68756000 -> 0x68757000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\gdi32.dll") failed (error c000007a).
0009:err:module:import_dll Library gdi32.dll (which is needed by L"C:\\windows\\system32\\comctl32.dll") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x68618E0C is outside of segment __DATA_CONST (0x6858C000 -> 0x6858D000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\imm32.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\imm32.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so, 258): malformed rebase opcodes (1663/4400): address 0x6876898C is outside of segment __DATA_CONST (0x68631000 -> 0x68635000) in /Users/sarimarton/Downloads/sources/wine/dlls/user32
0009:err:module:import_dll Loading library user32.dll (which is needed by L"C:\\windows\\system32\\imm32.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\imm32.dll") failed (error c000007a).
0009:err:module:import_dll Library imm32.dll (which is needed by L"C:\\windows\\system32\\comctl32.dll") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\comctl32.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so, 258): malformed rebase opcodes (1663/4400): address 0x6876898C is outside of segment __DATA_CONST (0x68631000 -> 0x68635000) in /Users/sarimarton/Downloads/sources/wine/dlls/user32
0009:err:module:import_dll Loading library user32.dll (which is needed by L"C:\\windows\\system32\\comctl32.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x68618E0C is outside of segment __DATA_CONST (0x6858C000 -> 0x6858D000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\usp10.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x687E2E0C is outside of segment __DATA_CONST (0x68756000 -> 0x68757000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\gdi32.dll") failed (error c000007a).
0009:err:module:import_dll Library gdi32.dll (which is needed by L"C:\\windows\\system32\\usp10.dll") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\usp10.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so, 258): malformed rebase opcodes (1663/4400): address 0x6876898C is outside of segment __DATA_CONST (0x68631000 -> 0x68635000) in /Users/sarimarton/Downloads/sources/wine/dlls/user32
0009:err:module:import_dll Loading library user32.dll (which is needed by L"C:\\windows\\system32\\usp10.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\usp10.dll") failed (error c000007a).
0009:err:module:import_dll Library usp10.dll (which is needed by L"C:\\windows\\system32\\comctl32.dll") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\comctl32.dll") failed (error c000007a).
0009:err:module:import_dll Library comctl32.dll (which is needed by L"C:\\windows\\system32\\comdlg32.dll") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x687E2E0C is outside of segment __DATA_CONST (0x68756000 -> 0x68757000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\gdi32.dll") failed (error c000007a).
0009:err:module:import_dll Library gdi32.dll (which is needed by L"C:\\windows\\system32\\comdlg32.dll") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\comdlg32.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/shell32/shell32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/shell32/shell32.dll.so, 258): malformed rebase opcodes (3392/5832): address 0x6C397E2C is outside of segment __DATA_CONST (0x6C260000 -> 0x6C264000) in /Users/sarimarton/Downloads/sources/wine/dlls/shel
0009:err:module:import_dll Loading library shell32.dll (which is needed by L"C:\\windows\\system32\\comdlg32.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x68618E0C is outside of segment __DATA_CONST (0x6858C000 -> 0x6858D000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\shlwapi.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x687E2E0C is outside of segment __DATA_CONST (0x68756000 -> 0x68757000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\gdi32.dll") failed (error c000007a).
0009:err:module:import_dll Library gdi32.dll (which is needed by L"C:\\windows\\system32\\shlwapi.dll") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\shlwapi.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so, 258): malformed rebase opcodes (1663/4400): address 0x6876898C is outside of segment __DATA_CONST (0x68631000 -> 0x68635000) in /Users/sarimarton/Downloads/sources/wine/dlls/user32
0009:err:module:import_dll Loading library user32.dll (which is needed by L"C:\\windows\\system32\\shlwapi.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\shlwapi.dll") failed (error c000007a).
0009:err:module:import_dll Library shlwapi.dll (which is needed by L"C:\\windows\\system32\\comdlg32.dll") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so, 258): malformed rebase opcodes (1663/4400): address 0x6876898C is outside of segment __DATA_CONST (0x68631000 -> 0x68635000) in /Users/sarimarton/Downloads/sources/wine/dlls/user32
0009:err:module:import_dll Loading library user32.dll (which is needed by L"C:\\windows\\system32\\comdlg32.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/winspool.drv/winspool.drv.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/winspool.drv/winspool.drv.so, 258): malformed rebase opcodes (103/216): address 0x6859C10C is outside of segment __DATA_CONST (0x6854E000 -> 0x6854F000) in /Users/sarimarton/Downloads/sources/wine/dlls/
0009:err:module:import_dll Loading library winspool.drv (which is needed by L"C:\\windows\\system32\\comdlg32.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\comdlg32.dll") failed (error c000007a).
0009:err:module:import_dll Library comdlg32.dll (which is needed by L"C:\\windows\\system32\\notepad.exe") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x687E2E0C is outside of segment __DATA_CONST (0x68756000 -> 0x68757000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\gdi32.dll") failed (error c000007a).
0009:err:module:import_dll Library gdi32.dll (which is needed by L"C:\\windows\\system32\\notepad.exe") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\notepad.exe") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/shell32/shell32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/shell32/shell32.dll.so, 258): malformed rebase opcodes (3392/5832): address 0x6C397E2C is outside of segment __DATA_CONST (0x6C260000 -> 0x6C264000) in /Users/sarimarton/Downloads/sources/wine/dlls/shel
0009:err:module:import_dll Loading library shell32.dll (which is needed by L"C:\\windows\\system32\\notepad.exe") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x68618E0C is outside of segment __DATA_CONST (0x6858C000 -> 0x6858D000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\shlwapi.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/advapi32/advapi32.dll.so, 258): malformed rebase opcodes (714/912): address 0x687E2E0C is outside of segment __DATA_CONST (0x68756000 -> 0x68757000) in /Users/sarimarton/Downloads/sources/wine/dlls/adva
0009:err:module:import_dll Loading library advapi32.dll (which is needed by L"C:\\windows\\system32\\gdi32.dll") failed (error c000007a).
0009:err:module:import_dll Library gdi32.dll (which is needed by L"C:\\windows\\system32\\shlwapi.dll") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\shlwapi.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so, 258): malformed rebase opcodes (1663/4400): address 0x6876898C is outside of segment __DATA_CONST (0x68631000 -> 0x68635000) in /Users/sarimarton/Downloads/sources/wine/dlls/user32
0009:err:module:import_dll Loading library user32.dll (which is needed by L"C:\\windows\\system32\\shlwapi.dll") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\shlwapi.dll") failed (error c000007a).
0009:err:module:import_dll Library shlwapi.dll (which is needed by L"C:\\windows\\system32\\notepad.exe") not found
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/user32/user32.dll.so, 258): malformed rebase opcodes (1663/4400): address 0x6876898C is outside of segment __DATA_CONST (0x68631000 -> 0x68635000) in /Users/sarimarton/Downloads/sources/wine/dlls/user32
0009:err:module:import_dll Loading library user32.dll (which is needed by L"C:\\windows\\system32\\notepad.exe") failed (error c000007a).
0009:err:module:load_so_dll failed to load .so lib "/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so": dlopen(/Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/msvcrt.dll.so, 258): malformed rebase opcodes (353/1304): address 0x686C2C14 is outside of segment __DATA_CONST (0x685E1000 -> 0x685E2000) in /Users/sarimarton/Downloads/sources/wine/dlls/msvcrt/
0009:err:module:import_dll Loading library msvcrt.dll (which is needed by L"C:\\windows\\system32\\notepad.exe") failed (error c000007a).
0009:err:module:LdrInitializeThunk Importing dlls for L"C:\\windows\\system32\\notepad.exe" failed, status c0000135
@ryandesign

This comment has been minimized.

Copy link

@ryandesign ryandesign commented May 7, 2020

If I use win32on64 I get a long list of address is outside of segment errors:

I got the same errors as you. Then I found this discussion which pointed to the solution: Build wine with the environment variable MACOSX_DEPLOYMENT_TARGET=10.14. That worked for me and wine32on64 is now running on Catalina for me. I'm in the process of updating the MacPorts wine-crossover port to include all this.

@sarimarton

This comment has been minimized.

Copy link

@sarimarton sarimarton commented May 10, 2020

@ryandesign, Brilliant! It worked indeed. Thanks for your efforts on MacPorts too.

@AgentRG

This comment has been minimized.

Copy link

@AgentRG AgentRG commented May 24, 2020

@ryandesign @sarimarton Hey you two. Was wondering if you could help me with the building Wine part. I have been following the guide and added the missing distversion.h in the include folder, but when running make, the build runs and prints similar looking -Werror errors and eventually ending with the following error. Any chance you could help me with this one?

clang -mwine32 -mstorage-address-space=default -minterop64-32-thunk-prefix=wine -minterop64-32-cs32-name=wine_32on64_cs32 -minterop64-32-cs64-name=wine_32on64_cs64 -mstack64 -mdefault-address-space=ptr32 -mstorage-address-space=ptr32 -mno-stack64 -c -o main.o main.c \
  -ilocal . -ilocal ../../include -ilocal ../../include/msvcrt -D__WINESRC__ -D_REENTRANT -fPIC \
  -fno-builtin -fshort-wchar -mabi=ms -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement \
  -Wempty-body -Wignored-qualifiers -Wno-pragma-pack -Wstrict-prototypes -Wtype-limits -Wvla \
  -Wwrite-strings -Wpointer-arith -gdwarf-2 -gstrict-dwarf -Werror=extra-tokens \
  -Werror=implicit-function-declaration -Werror=incompatible-function-pointer-types \
  -Werror=incompatible-pointer-types-discards-qualifiers -Werror=incompatible-pointer-types \
  -Werror=pointer-to-int-cast-truncates -Werror=pointer-to-int-cast \
  -Werror=int-to-pointer-cast-truncates -Werror=out-of-scope-function -Werror=pointer-arith \
  -Werror=pointer-type-mismatch -Werror=strict-prototypes \
  -Werror=tautological-constant-out-of-range-compare -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
In file included from main.c:28:
../../include/wine/debug.h:196:40: error: passing 'const char * __ptr64 __storage32' to parameter of type 'const __storage32 char *' changes address space of pointer
    vsnprintf( buffer, sizeof(buffer), format, args );
                                       ^~~~~~
../../include/msvcrt/stdio.h:302:68: note: passing argument to parameter 'format' here
static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format,args); }
                                                                   ^
In file included from main.c:28:
../../include/wine/debug.h:208:40: error: passing 'const char * __ptr64 __storage32' to parameter of type 'const __storage32 char *' changes address space of pointer
    vsnprintf( buffer, sizeof(buffer), format, args );
                                       ^~~~~~
../../include/msvcrt/stdio.h:302:68: note: passing argument to parameter 'format' here
static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format,args); }
                                                                   ^
In file included from main.c:28:
../../include/wine/debug.h:232:40: error: passing 'const char * __ptr64 __storage32' to parameter of type 'const __storage32 char *' changes address space of pointer
    vsnprintf( buffer, sizeof(buffer), format, args );
                                       ^~~~~~
../../include/msvcrt/stdio.h:302:68: note: passing argument to parameter 'format' here
static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format,args); }
                                                                   ^
3 errors generated.
make[1]: *** [main.o] Error 1
make: *** [dlls/acledit] Error 2
@ryandesign

This comment has been minimized.

Copy link

@ryandesign ryandesign commented May 24, 2020

@AgentRG See this entry in the discussion I mentioned previously. You're missing the mingw-w64 dependency. If you're using MacPorts, that's sudo port install i686-w64-mingw32-gcc.

@ryandesign

This comment has been minimized.

Copy link

@ryandesign ryandesign commented May 24, 2020

...I mean sudo port install x86_64-w64-mingw32-gcc.

@ryandesign

This comment has been minimized.

Copy link

@ryandesign ryandesign commented May 24, 2020

...No I had it right the first time. You need i686-w64-mingw32-gcc if you're building wine32 or wine32on64 and x86_64-w64-mingw32-gcc if you're building wine64.

@michaeldam

This comment has been minimized.

Copy link

@michaeldam michaeldam commented May 24, 2020

I'm stuck at wine at the same point as AgentRG

I did the configure using: CC="clang" CXX="clang++" ./configure --enable-win32on64

Now I did install ming64 using brew
brew install mingw-w64

However, as I still get the same compile errors, I think I need to set specific env variables or extend the PATH for configure/make to pick it up. Or might it be the wrong mingw version (but it's the only one I found through brew)?

I'm clueless at this point. So any hint is appreciated.

Edit: oops. Obviously had to run configure after installing mingw-w64. I just got past the compile errors

@ryandesign

This comment has been minimized.

Copy link

@ryandesign ryandesign commented May 24, 2020

I recommend running ./configure with --with-mingw so that it will bail out at configure time if you don't have the right mingw-w64 installed.

@michaeldam

This comment has been minimized.

Copy link

@michaeldam michaeldam commented May 24, 2020

Much further compiling wine but stuck at this error where a 64-bit unsigned long is not the same size as a 32-bit pointer which is true.

clang -mwine32 -mstorage-address-space=default -minterop64-32-thunk-prefix=wine -minterop64-32-cs32-name=wine_32on64_cs32 -minterop64-32-cs64-name=wine_32on64_cs64 -mstack64 -mdefault-address-space=ptr32 -mstorage-address-space=ptr32 -mno-stack64 -c -o vulkan.o vulkan.c
-ilocal . -ilocal ../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing
-Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Wno-pragma-pack
-Wstrict-prototypes -Wtype-limits -Wvla -Wwrite-strings -Wpointer-arith -gdwarf-2 -gstrict-dwarf
-Werror=extra-tokens -Werror=implicit-function-declaration
-Werror=incompatible-function-pointer-types -Werror=incompatible-pointer-types-discards-qualifiers
-Werror=incompatible-pointer-types -Werror=pointer-to-int-cast-truncates
-Werror=pointer-to-int-cast -Werror=int-to-pointer-cast-truncates -Werror=out-of-scope-function
-Werror=pointer-arith -Werror=pointer-type-mismatch -Werror=strict-prototypes
-Werror=tautological-constant-out-of-range-compare -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
In file included from vulkan.c:26:
./vulkan_private.h:125:12: error: cast to '__storage32 struct latent-__storage32 wine_cmd_pool *' from larger integer type 'unsigned long'
[-Werror,-Wint-to-pointer-cast-truncates]
return (struct wine_cmd_pool *)(uintptr_t)handle;

Anyone ran into this?

@sarimarton

This comment has been minimized.

Copy link

@sarimarton sarimarton commented May 24, 2020

I'm a layman, and didn't run into your issue, but I've forked this gist and collected the steps in a script while I was retrying with the new suggestions coming in. That script compiled it for me. Maybe it helps: https://gist.github.com/sarimarton/471e9ff8046cc746f6ecb8340f942647

@michaeldam

This comment has been minimized.

Copy link

@michaeldam michaeldam commented May 24, 2020

Awesome. Thanks man. The tow diffs are that you added the 'MACOSX_DEPLOYMENT_TARGET=10.14' to configure and you added '-disable-winedbg --without-x --without-vulkan --disable-mscms'.
Since I'm stuck on vulcan that for sure will help. Not too sure about MACOSX_DEPLOYMENT_TARGET as I did have it exported but I'll include it anyway. It has been 20-odd years since I ran my last serious make :-).
Thanks again. Also for the script. I was going to have to create that myself once successful. Good stuff :-)
I'll post here any proceedings.
Cheers

@AgentRG

This comment has been minimized.

Copy link

@AgentRG AgentRG commented May 24, 2020

Thanks everyone. Wine managed to build. Compiler also complained about freetype, so I had to exclude it as well. My final command looked like this:

CC="clang" CXX="clang++" MACOSX_DEPLOYMENT_TARGET=10.14 ./configure --enable-win32on64 -disable-winedbg --without-x --without-vulkan --disable-mscms --without-freetype

So as I understand, simply using wine as a command won't work, only wine32on64? Otherwise I'm getting wine: could not find the Wine loader error that was posted before. I wonder if it's possible to install winetricks after all of this.

Man Catalina brought so much trouble for Wine users.

@michaeldam

This comment has been minimized.

Copy link

@michaeldam michaeldam commented May 25, 2020

First did a make clean and a config using the additional parameters like suggested by sarimarton.

Started make and Left it for the night. This is the tail of the results. I don't think I'll have time until next weekend to dig further but will try. The last step targets main.cross.o and fails a lib can't be found:
'dyld: Library not loaded: @rpath/libfreetype.6.dylib
Referenced from: /Users/michael/Projects/CrossOver/sources/wine/fonts/../tools/sfnt2fon/sfnt2fon'
The 'Referenced from' appears wrong: /Users/michael/Projects/CrossOver/sources/wine/fonts/tools/sfnt2fon/sfnt2fon is the correct path. But that's not the issue I don't think: it's @rpath/libfreetype.6.dylib that's missing.
I'll have to dig further later. Possibly someone else recognizes this as an obvious error and can give me a hint.

Full tail having main.cross.o as a target twice righ after each other (something else I did not get but I'm prepared to ignore)

i686-w64-mingw32-gcc -c -o main.cross.o main.c -I . -I ../../include -I ../../include/msvcrt -D__WINESRC__
-DWINE_CROSS_PE -Wall -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body
-Wignored-qualifiers -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits
-Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op
-fno-omit-frame-pointer -gdwarf-2 -gstrict-dwarf -g -O2
In file included from main.c:25:
../../include/wine/debug.h: In function ‘wine_dbgstr_an’:
../../include/wine/debug.h:244:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
244 | if (!((ULONGLONG)str >> 16)) return wine_dbg_sprintf( "#%04x", LOWORD(str) );
| ^
../../include/wine/debug.h: In function ‘wine_dbgstr_wn’:
../../include/wine/debug.h:286:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
286 | if (!((ULONGLONG)str >> 16)) return wine_dbg_sprintf( "#%04x", LOWORD(str) );
| ^
../../include/wine/debug.h: In function ‘wine_dbgstr_guid’:
../../include/wine/debug.h:337:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
337 | if (!((ULONGLONG)id >> 16)) return wine_dbg_sprintf( "<guid-0x%04hx>", (WORD)(ULONGLONG)id );
| ^
../../include/wine/debug.h:337:82: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
337 | if (!((ULONGLONG)id >> 16)) return wine_dbg_sprintf( "<guid-0x%04hx>", (WORD)(ULONGLONG)id );
| ^
../../tools/wrc/wrc -o xpsprint.res -m32 --nostdinc -I . -I ../../include -I ../../include/msvcrt
-D__WINESRC__ xpsprint.rc
../../tools/winegcc/winegcc -o xpsprint.dll -B../../tools/winebuild -b i686-w64-mingw32 --lib-suffix=.cross.a
-Wl,--wine-builtin -shared xpsprint.spec -mno-cygwin main.cross.o xpsprint.res
i686-w64-mingw32-gcc -c -o main.cross.o main.c -I . -I ../../include -I ../../include/msvcrt -D__WINESRC__
-DWINE_CROSS_PE -Wall -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body
-Wignored-qualifiers -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits
-Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op
-fno-omit-frame-pointer -gdwarf-2 -gstrict-dwarf -g -O2
../../tools/winegcc/winegcc -o xpssvcs.dll -B../../tools/winebuild -b i686-w64-mingw32 --lib-suffix=.cross.a
-Wl,--wine-builtin -shared xpssvcs.spec -mno-cygwin main.cross.o
../tools/sfnt2fon/sfnt2fon -q -o coue1255.fon courier.ttf -d 128 13,1255,8
dyld: Library not loaded: @rpath/libfreetype.6.dylib
Referenced from: /Users/michael/Projects/CrossOver/sources/wine/fonts/../tools/sfnt2fon/sfnt2fon
Reason: image not found
make[1]: *** [coue1255.fon] Abort trap: 6
make: *** [fonts] Error 2

Edit: solved by performing the following command
brew install freetype

Edit2: successfully able to run
./wine32on64 notepad

Thanks for all the help!

@michaeldam

This comment has been minimized.

Copy link

@michaeldam michaeldam commented May 25, 2020

CC="clang" CXX="clang++" MACOSX_DEPLOYMENT_TARGET=10.14 ./configure --enable-win32on64 -disable-winedbg --without-x --without-vulkan --disable-mscms

ends in:

configure: QuickTime 64-bit development files not found, video decoding won't be supported.
configure: libinotify 64-bit development files not found (or too old), filesystem change notifications won't be supported.
configure: libsane 64-bit development files not found, scanners won't be supported.
configure: libv4l2 64-bit development files not found.
configure: libgphoto2 64-bit development files not found, digital cameras won't be supported.
configure: libgphoto2_port 64-bit development files not found, digital cameras won't be auto-detected.
configure: liblcms2 64-bit development files not found, Color Management won't be supported.
configure: libpulse 64-bit development files not found or too old, Pulse won't be supported.
configure: gstreamer-1.0 base plugins 64-bit development files not found, GStreamer won't be supported.
configure: OSS sound system found but too old (OSSv4 needed), OSS won't be supported.
configure: libudev 64-bit development files not found, plug and play won't be supported.
configure: libSDL2 64-bit development files not found, SDL2 won't be supported.
configure: libFAudio 64-bit development files not found, XAudio2 won't be supported.
configure: libcapi20 64-bit development files not found, ISDN won't be supported.
configure: libgsm 64-bit development files not found, gsm 06.10 codec won't be supported.
configure: libtiff 64-bit development files not found, TIFF won't be supported.
configure: vkd3d 64-bit development files not found (or too old), Direct3D 12 won't be supported.
configure: WARNING: libgnutls 64-bit development files not found, no schannel support.
configure: WARNING: libjpeg 64-bit development files not found, JPEG won't be supported.
configure: WARNING: libpng 64-bit development files not found, PNG won't be supported.

And I honestly don't know if this is a showstopper in the first place.

@AgentRG

This comment has been minimized.

Copy link

@AgentRG AgentRG commented May 25, 2020

How odd... even notepad won't launch after building has finished. Getting this error, maybe division by 0 is the source?

swtor@SWTORs-MacBook-Pro wine % ./wine32on64 notepad        
001d:err:plugplay:process_IOService_Device object 0x3803
001d:err:plugplay:process_IOService_Device Unable to create plug in interface for USB deviceobject 0x3807
001d:err:plugplay:process_IOService_Device object 0xa203
wine: Unhandled division by zero at address 0x1007:0x7bca2c05 (thread 0009), starting debugger...
0009:err:seh:start_debugger Couldn't start debugger ("winedbg --auto 8 100") (2)
Read the Wine Developers Guide on how to set up winedbg or another debugger
swtor@SWTORs-MacBook-Pro wine % ./wine32on64 winecfg
001d:err:plugplay:process_IOService_Device object 0x4303
001d:err:plugplay:process_IOService_Device Unable to create plug in interface for USB deviceobject 0x4307
001d:err:plugplay:process_IOService_Device object 0x5503
@michaeldam

This comment has been minimized.

Copy link

@michaeldam michaeldam commented May 25, 2020

screenshot_48

Flawless over here. I did not exclude freetype. As mentioned above, I installed it with brew in order to be able to complete the build. brew install freetype
@AgentRG

This comment has been minimized.

Copy link

@AgentRG AgentRG commented May 26, 2020

@michaeldam Yea, looks like freetype is required. Otherwise nothing launches. Thanks for the tip.

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 5, 2020

When I try to compile clang, I get this error:
In file included from /Users/rohanraman/CompApps/clang-10.0.0.src/utils/TableGen/ASTTableGen.cpp:15: /Users/rohanraman/CompApps/clang-10.0.0.src/utils/TableGen/ASTTableGen.h:12:10: fatal error: 'llvm/TableGen/Record.h' file not found #include "llvm/TableGen/Record.h" ^~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. make[2]: *** [utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ASTTableGen.cpp.o] Error 1 make[1]: *** [utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/all] Error 2

@tellowkrinkle

This comment has been minimized.

Copy link

@tellowkrinkle tellowkrinkle commented Jun 6, 2020

@Firebirdnj8 You want to compile the custom clang that comes in the crossover source, not normal clang 10
(If you were wondering, I would guess your error is because the clang 10 source is meant to be compiled along with LLVM so if you don't it probably fails)

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 6, 2020

Ok, thank you. Another thing is that I downloaded LLVM and Clang from the official websites, and compiled separately. Maybe that is why. I will try again.

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 6, 2020

It compiled, now I get wine32on64: could not locate the Wine build tree and also wine: could not locate the Wine build tree

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 6, 2020

I do have a Linux server available, should I build on that and copy the files?

@ryandesign

This comment has been minimized.

Copy link

@ryandesign ryandesign commented Jun 7, 2020

I downloaded LLVM and Clang from the official websites, and compiled separately

That cannot compile Crossover's wine with the win32on64 feature. Only Crossover's specially modified clang and llvm can do that.

could not locate the Wine build tree

I haven't heard of that before. Search Google?

I do have a Linux server available, should I build on that and copy the files?

I don't see how that would help. If you want to run this on macOS, compile it on macOS. Cross compilation is a major additional headache.

@michaeldam

This comment has been minimized.

Copy link

@michaeldam michaeldam commented Jun 7, 2020

Ok, thank you. Another thing is that I downloaded LLVM and Clang from the official websites, and compiled separately. Maybe that is why. I will try again.

It's literally at the top of this post 😁
"Go to CodeWeavers CrossOver FOSS version Source and download the source."
This wine build tree comes with the right LLVM and Clang.

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 7, 2020

Ok, thank you. Another thing is that I downloaded LLVM and Clang from the official websites, and compiled separately. Maybe that is why. I will try again.

It's literally at the top of this post 😁
"Go to CodeWeavers CrossOver FOSS version Source and download the source."
This wine build tree comes with the right LLVM and Clang.

As you can see in my replies, I did compile the included LLVM and Clang once specified. Since the website did not list those two as included sources, I did not think that they were custom compilers. Giving me answers to questions that have already been solved does not help.

@michaeldam

This comment has been minimized.

Copy link

@michaeldam michaeldam commented Jun 9, 2020

I compiled the bits and pieces from others and myself into a step-by-step that should work

Getting the source code

Get Codeweaver's Wine FOSS here:

https://www.codeweavers.com/products/more-information/source

untar it

Installing build prerequisites

To install brew packet manager issue (from the Brew site):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Next install the following packages:

brew install bison

The following PATH extension is required to make sure the latest bison is used over macOS' default:

export PATH=/usr/local/Cellar/bison/3.6.2/bin:$PATH
edit: ...probable better like this. Credits to @tellowkrinkle:
export PATH=$(brew --prefix bison):$PATH

brew install mingw-w64
brew install freetype

Compiling LLVM

Go to llvm directory and create build directory with command mkdir build.
cd build to go there and run cmake ../ to configure build directory.
When cmake is done, you can run make to compile.
This will take a long time... Take your time and have a break.
(Build Time: 1h 25m 45s on 2018 Macbook Pro with intel Core i9 Processor)
now cd bin and add binaries to PATH via export PATH="$(pwd):$PATH".

Compiling Clang

Go to clang directory and create build directory with command mkdir build. (PATH setup from llvm required!!)
cd build to go there and run cmake ../ to configure build directory.
When cmake is done, you can run make to compile.
This will take some time... Take your time and have a break.
(Build Time: 34m 36s on 2018 Macbook Pro with intel Core i9 Processor)
now cd bin and add binaries to PATH via export PATH="$(pwd):$PATH".

Compiling Wine

Go to wine directory

The custom build of wine by codeweavers have special flag called --enable-win32on64.
Use that too when you setup with ./configure.
Use command

CC="clang" CXX="clang++" MACOSX_DEPLOYMENT_TARGET=10.14 ./configure --enable-win32on64 -disable-winedbg --without-x --without-vulkan --disable-mscms

Then compile with

make

Cleanup

To cleanup ./configure targets issue:

make distclean

To clean up wine targets issue:

make clean

Allowing Windows apps to run

In the directory of the Windows executable issue:

sudo xattr -d com.apple.quarantine *

@AgentRG

This comment has been minimized.

Copy link

@AgentRG AgentRG commented Jun 10, 2020

@michaeldam How does disabling Mac's SIP differentiate from removing quarantine on an exe?

@tellowkrinkle

This comment has been minimized.

Copy link

@tellowkrinkle tellowkrinkle commented Jun 10, 2020

export PATH=/usr/local/Cellar/bison/3.6.2/bin:$PATH

You can use export PATH=$(brew --prefix bison):$PATH so that even if Homebrew's bison gets updated to something higher than 3.6.2 the command will still work

How does disabling Mac's SIP differentiate from removing quarantine on an exe?

SIP prevents all applications running on your Mac from doing specific dangerous things (e.g. modifying system files)

Quarantine prevents unsigned applications downloaded from the internet from running at all. Unsurprisingly, windows applications aren't signed in a way macOS recognizes, so macOS prevents them from running. Removing the quarantine flag allows them to run. This is normally done by right-clicking, choosing Open, and then okaying the "OMG this thing could be dangerous" prompt, but since you can't run the windows application by right-clicking and choosing Open, you have to manually remove the quarantine flag.

@HarukaMa

This comment has been minimized.

Copy link

@HarukaMa HarukaMa commented Nov 30, 2020

A few points:

For LLVM, you may add -DLLVM_TARGETS_TO_BUILD=X86 to cmake command line as most probably you only need x86 target when using this version.

For both LLVM and Clang, you may add -DCMAKE_BUILD_TYPE=Release to cmake command line to build an optimized version. Compiling those two components could be slower, but the actual compiling process should be much faster.

@kiding

This comment has been minimized.

Copy link

@kiding kiding commented Dec 4, 2020

Just to note: 20.0.1, 20.0.2 (and possibly later versions) do not contain the clang/llvm source codes. Use 20.0.0 or older versions.

@Molanda

This comment has been minimized.

Copy link

@Molanda Molanda commented Dec 10, 2020

For me, brew --prefix bison returns /usr/local/opt/bison, so I had to use...

export PATH=$(brew --prefix bison)/bin:$PATH
@Molanda

This comment has been minimized.

Copy link

@Molanda Molanda commented Dec 10, 2020

It seems the compiler is now picky about missing extern in the C code. I had to alter the configure statement to...

CROSSCFLAGS="-g -O2 -fcommon" CC="clang" CXX="clang++" MACOSX_DEPLOYMENT_TARGET=10.14 ./configure --enable-win32on64 -disable-winedbg --without-x --without-vulkan --disable-mscms
@firefinchdev

This comment has been minimized.

Copy link

@firefinchdev firefinchdev commented Dec 19, 2020

Go to llvm directory and create build directory with command mkdir build.
cd build to go there and run cmake ../ to configure build directory.

Which one is the LLVM directory?

@ryandesign

This comment has been minimized.

Copy link

@ryandesign ryandesign commented Dec 19, 2020

Which one is the LLVM directory?

The directory called "llvm" that is inside the the directory that is created when you decompress the crossover 20.0.0 tarball. As noted above, 20.0.1 and later no longer include the llvm directory so they cannot be used for this step.

@firefinchdev

This comment has been minimized.

Copy link

@firefinchdev firefinchdev commented Dec 19, 2020

The directory called "llvm" that is inside the the directory that is created when you decompress the crossover 20.0.0 tarball. As noted above, 20.0.1 and later no longer include the llvm directory so they cannot be used for this step.

Thanks. I was using 20.0.2 (latest) and llvm directory was not there. Using 20.0.0 now.

@GabLeRoux

This comment has been minimized.

Copy link

@GabLeRoux GabLeRoux commented Dec 21, 2020

Based on related gists, I created this repository:
https://github.com/GabLeRoux/macos-crossover-cloud-build

The CI build fails, but script works fine (still getting build issues). There's a couple issues which you can contribute to if you want. I find it more convenient to use repositories instead of gists as it's easier to contribute.

@sarimarton

This comment has been minimized.

Copy link

@sarimarton sarimarton commented Dec 21, 2020

It's a great idea, thanks @GabLeRoux

@Muzi-Chan

This comment has been minimized.

Copy link

@Muzi-Chan Muzi-Chan commented May 15, 2021

I may be late, but you can add something really important for speed
Instead of make
make -j4or another number, it's the number of core that make uses
It really speed up the process a lot, it take the normal time, divided by the number, almost

@Alex4386

This comment has been minimized.

Copy link
Owner Author

@Alex4386 Alex4386 commented May 19, 2021

I may be late, but you can add something really important for speed
Instead of make
make -j4or another number, it's the number of core that make uses
It really speed up the process a lot, it take the normal time, divided by the number, almost

I thought it was kind of obvious of using -j`nproc` or equivalent but kudos for you. Next time, I will add that in the future build guide.

By the way, this gist is deprecated.
Please visit the updated gist on top of this gist. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment