Howdy,
I recently tried compiling Wine with tcc, which found a few bugs. I've
filed some on Savannah (and have before as well), but that didn't
garner much attention, so I'm writing here as well. If that's
unwelcome, please let me know and I'll refrain :).
Now then, I used wine-1.5.12 (recent development snapshot), and tinycc
from git (commit 56e23984b9cd3b58e1766748524e63f8301ccd68). Compared
to 0.9.25, it gets much further, a couple of my bugs were fixed
already:
https://savannah.nongnu.org/bugs/?33010 - configure misses most dependencies
https://savannah.nongnu.org/bugs/?33713 - tinycc doesn't support u_int64_t
the new bugs:
https://savannah.nongnu.org/bugs/?37240 - tinycc: unknown opcode 'movq'
https://savannah.nongnu.org/bugs/?37241 - tinycc: 'error: bad
expression syntax [.]' on some wine files
https://savannah.nongnu.org/bugs/?37242 - tinycc: tmarshal.h:761:
error: identifier expected (wine)
https://savannah.nongnu.org/bugs/?37243 - tinycc: fails to compile
wine's dlls/d3d8/tests/stateblock.c file
https://savannah.nongnu.org/bugs/?37244 - tinycc: lacks -nostartfiles
-nodefaultlibs support, needed by Wine
there are a couple other issues, that I haven't filed bugs for:
A) running ./configure fails to detect libhal and opengl. This can be
worked around by doing:
CC="tcc -L/usr/lib" ./configure
B) TinyCC doesn't seem to support DECLSPEC_HIDDEN / DECLSPEC_HOTPATCH.
C) There are some other areas that fail to compile, though those
appear to be Wine bugs. I've attached a (very hacky) patch that
(mostly) allows wine to compile. For the files mentioned above that
don't compile, make CC=gcc was used to work around it.
After that, wine segfaults on launch, so there's obviously more work
to be done, but these issues make narrowing down that problem harder.
I'd be happy to test any tcc patches, if needed. I've attached
testcases for some of the bugs, when possible. I attempted to use
delta (http://delta.tigris.org/) to narrow down the problems more, but
it seems tinycc doesn't support dumping the preprocessed code?
--
-Austin
commit 9a9171901c3145df95e421eeab55c7ab005d0661
Author: Austin English
Date: Fri Aug 31 15:04:58 2012 -0700
asdf
diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c
index 385ace4..d0ad0e7 100644
--- a/dlls/advapi32/lsa.c
+++ b/dlls/advapi32/lsa.c
@@ -627,7 +627,7 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
*/
PPOLICY_PRIMARY_DOMAIN_INFO pinfo;
-pinfo = ADVAPI_GetDomainName(sizeof(*pinfo),
offsetof(POLICY_PRIMARY_DOMAIN_INFO, Name));
+//pinfo = ADVAPI_GetDomainName(sizeof(*pinfo),
offsetof(POLICY_PRIMARY_DOMAIN_INFO, Name));
TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer));
@@ -677,7 +677,7 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
*/
PPOLICY_DNS_DOMAIN_INFO pinfo;
-pinfo = ADVAPI_GetDomainName(sizeof(*pinfo),
offsetof(POLICY_DNS_DOMAIN_INFO, Name));
+//pinfo = ADVAPI_GetDomainName(sizeof(*pinfo),
offsetof(POLICY_DNS_DOMAIN_INFO, Name));
TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer));
diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h
index ea85cbc..950fe4b 100644
--- a/dlls/crypt32/crypt32_private.h
+++ b/dlls/crypt32/crypt32_private.h
@@ -149,7 +149,7 @@ BOOL WINAPI CRYPT_AsnEncodePubKeyInfoNoNull(DWORD
dwCertEncodingType,
*/
HCRYPTPROV CRYPT_GetDefaultProvider(void) DECLSPEC_HIDDEN;
-HINSTANCE hInstance DECLSPEC_HIDDEN;
+extern HINSTANCE hInstance DECLSPEC_HIDDEN;
void crypt_oid_init(void) DECLSPEC_HIDDEN;
void crypt_oid_free(void) DECLSPEC_HIDDEN;
diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c
index 3405447..84d1469 100644
--- a/dlls/d3d8/d3d8_main.c
+++ b/dlls/d3d8/d3d8_main.c
@@ -35,7 +35,7 @@ void WINAPI DebugSetMute(void) {
/* nothing to do */
}
-IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version)
+extern IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version)
{
struct d3d8 *object;
diff --git a/dlls/d3d8/tests/Makefile.in b/dlls/d3d8/tests/Makefile.in
index 14fa2fc..7df81bf 100644
--- a/dlls/d3d8/tests/Makefile.in
+++ b/dlls/d3d8/tests/Makefile.in
@@ -5,7 +5,6 @@ C_SRCS = \
buffer.c \
d3d8_main.c \
device.c \
- stateblock.c \
surface.c \
texture.c \
visual.c \
diff --git a/dlls/d3d9/tests/Makefile.in b/dlls/d3d9/tests/Makefile.in
index 4c4ce0f..b3be706 100644
--- a/dlls/d3d9/tests/Makefile.in
+++ b/dlls/d3d9/tests/Makefile.in
@@ -7,7 +7,6 @@ C_SRCS = \
device.c \
query.c \
shader.c \
- stateblock.c \
surface.c \
texture.c \
vertexdeclaration.c \
diff --git a/dlls/d3dx9_36/tests/Makefile.in b/dlls/d3dx9_36/tests/Makefile.in
index 5384705..01bc538 100644
--- a/dlls/d3dx9_36/tests/Makefile.in
+++ b/dlls/d3dx9_36/tests/Makefile.in
@@ -6,9 +6,6 @@ C_SRCS = \
core.c \
e