Clang
Clang is a compiler front end for the C, C++, and Objective-C programming languages, using the Low Level Virtual Machine (LLVM) as its back end. The goal is to offer a replacement to the GNU Compiler Collection (GCC) software stack.
To compile wine with Clang, use:
#!/bin/bash export CC=clang export CXX=clang export CFLAGS="-std=gnu89 -g" ./configure make
The following patch forces an aligned stack, which works around some of the bugs:
diff --git a/include/windef.h b/include/windef.h
index 9cf98e7..bc2d82e 100644
--- a/include/windef.h
+++ b/include/windef.h
@@ -53,11 +53,7 @@ extern "C" {
#ifndef __stdcall
# ifdef __i386__
# ifdef __GNUC__
-# ifdef __APPLE__ /* Mac OS X uses a 16-byte aligned stack and not a 4-byte one */
# define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))
-# else
-# define __stdcall __attribute__((__stdcall__))
-# endif
# elif defined(_MSC_VER)
/* Nothing needs to be done. __stdcall already exists */
# else
Known bugs
Bug |
Wine bug url |
clang bug url |
Fixed in version/workaround |
No support for .cfi_adjust_cfa_offset, .cfi_rel_offset, .cfi_same_value |
n/a |
r129378 (pre3.0 trunk) |
|
Wine fails to compile at "-O1" (in 2.9/svn) |
n/a |
r137292 (pre3.0 trunk) |
|
Wine fails to compile with Clang 2.8 on OSX |
|
||
Clang doesn't fail on unsupported options |
|||
comdlg32:finddlg test hangs indefinitely |
|||
Wine's regedit crashes |
stack alignment patch |
||
msvcp90/string test crashes |
|
clang version 3.1 (trunk 150446) |
|
msctf/categorymgr.c test crashes |
Wine 1.3.32 |
||
shdocvw:ie test crashes |
|||
oleaut32:tmarshal test crashes |
|||
user32:dialog test fails |
|||
wineboot crashes in cabinet.dll |
stack alignment patch |
||
wine segfaults on launch with -O2 |
|
||
Can't build wine in 64-bit mode |
n/a |
||
Clang doesn't support ms_hook_prologue |
n/a |
||
Dragonegg fails to compiler loader/preloader.c |
|||
Clang doesn't support -no-defaultlibs |
n/a |
