http://bugs.winehq.org/show_bug.cgi?id=33546
Bug #: 33546 Summary: MSVC 2012 C compiler (cl.exe) fails/crashes Product: Wine Version: 1.5.29 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: wine@martin.st Classification: Unclassified
For MSVC 2010, the plain C compiler binary (cl.exe) has worked just fine when run in wine, if extracted from an existing installation of MSVC. For MSVC 2012, the compiler binary fails/crashes. The exact reason is still unknown, but it seems like the compiler corrupts the heap at some point.
To reproduce, copy the following files from an MSVC 2012 installation:
From Microsoft Visual Studio 11.0\Common7\IDE:
mspdb110.dll
From Microsoft Visual Studio 11.0\VC\bin:
cl.exe c1.dll c2.dll 1033/clui.dll
And optionally from Microsoft Visual Studio 11.0\VC\redist\x86\Microsoft.VC110.CRT: msvcr110.dll msvcp110.dll
Then using these files, try to compile a simple C file containing:
int main(int argc, char* argv[]) { return 0; }
wine cl.exe -c test.c
This currently ends with the following error: err:seh:setup_exception_record stack overflow 848 bytes in thread 0009 eip f74e847d esp 00230fe0 stack 0x230000-0x231000-0x330000
If the native msvcr110.dll isn't used, this fails due to some unimplemented function. Stubs for these can be added by the crude, proof of concept patches attached, which also gets rid of a number of other fixmes printed. The third patch adds calls _heapchk() after each memset, to pinpoint one particular memset call (with length parameter 0x6f0) that seems to corrupt the heap. The actual cause for this is still unknown though.