public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/6] MSVC fixes
@ 2012-03-22 23:26 Peter Rosin
  2012-03-22 23:26 ` [PATCH 6/6] Add Microsoftian variant of the cdecl ABI Peter Rosin
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Peter Rosin @ 2012-03-22 23:26 UTC (permalink / raw)
  To: libffi-discuss

Hi!

This series fixes a number of problems that MSVC has with libffi.

The first patches are pretty mechanic, but the last one adds a
new ABI for x86-win32.  As it happens, Microsoft and GCC does not
agree on the details of the cdecl calling convention when they
are returning structures (at least).  MS thinks that the caller
pops the hidden structure return address and GCC thinks that
the callee should do it.  And MS relies on the callee to return
the structure return address in eax, while GCC seems to not care
about that (which is pretty sane, the compiler should be able
to keep track och where it did put that structure after all).

With the patches the testsuite behaves *much* better for MSVC.
What still fails is return_uc.c (crashes, but works when running
in the debugger), struct1_win32.c, struct2_win32.c (haven't
really looked, they crash) and closure_thiscall.c (no support for
using __thiscall from C apparently). And both the C++ tests fail
(haven't looked at all).

It would be interesting to see if MSVC can call into a libffi
built by GCC and vice versa, to check if the structure return
discrepancy really is fixed.  That should be possible if I did
this right, right?

Cheers,
Peter

[PATCH 1/6] Put declarations before statements, C89 style
[PATCH 2/6] Add kludge for missing format specifiers on MSVC
[PATCH 3/6] Remove surplus frame from MASM function entry
[PATCH 4/6] Use __fastcall for MSVC
[PATCH 5/6] Translate inline assembly to MSVC format
[PATCH 6/6] Add Microsoftian variant of the cdecl ABI

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-03-30 12:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22 23:26 [PATCH 0/6] MSVC fixes Peter Rosin
2012-03-22 23:26 ` [PATCH 6/6] Add Microsoftian variant of the cdecl ABI Peter Rosin
2012-03-29 18:21   ` [PATCH 6/6 try 2] " Peter Rosin
2012-03-30 12:48     ` Anthony Green
2012-03-22 23:26 ` [PATCH 2/6] Add kludge for missing format specifiers on MSVC Peter Rosin
2012-03-22 23:26 ` [PATCH 1/6] Put declarations before statements, C89 style Peter Rosin
2012-03-22 23:26 ` [PATCH 3/6] Remove surplus frame from MASM function entry Peter Rosin
2012-03-22 23:33 ` [PATCH 4/6] Use __fastcall for MSVC Peter Rosin
2012-03-22 23:33 ` [PATCH 5/6] Translate inline assembly to MSVC format Peter Rosin
2012-03-23  0:13 ` [PATCH 0/6] MSVC fixes Peter Rosin
2012-03-23  0:23 ` Anthony Green
2012-03-23  7:35   ` Peter Rosin
2012-03-23 10:03     ` Peter Rosin
2012-03-23 10:04       ` Peter Rosin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).