mingw compile issues

Daniel Atallah daniel.atallah at gmail.com
Wed Nov 9 19:15:54 EST 2011

On Mon, Nov 7, 2011 at 21:28, Lucas Fisher <lucas.fisher at gmail.com> wrote:
> I'm compiling im.pidgin head on Windows roughly following
> http://developer.pidgin.im/ticket/14678.  I was able to get this
> compiling and sort out all the dependencies.  However, I found that
> Pidgin would crash when you quit.  I traced this to WinMain in
> pidgin/win32/winpidgin.c. It crashes because when WinMain returns the
> stack pointer is not pointing to the return address, but other data on
> the stack. It almost looks like the compiler is messing up and
> generating the wrong instructions. When I turn off optimizations this
> problem goes away.
> Has anyone else seen this behavior?
> Lucas
> Relevant code:
> loc_40213A:
> mov     [esp+0CACh+var_CAC], edi
> call    LocalFree
> push    ecx
> mov     [esp+0CACh+var_CA4], ebp
> mov     [esp+0CACh+var_CA8], esi
> mov     eax, [esp+0CACh+hInstance]
> mov     [esp+0CACh+var_CAC], eax
> call    ds:dword_408024   # is the calling convention correct here?
> sub     esp, 0Ch            # this instruction misaligns the stack pointer
> add     esp, 0CACh
> pop     ebx
> pop     esi
> pop     edi
> pop     ebp
> retn    10h

Which version of gcc are you using to build?

I've seen some weirdness with optimizations in mingw gcc 4.6.


More information about the Devel mailing list