public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Anthony Green <green@moxielogic.com>
To: libffi-discuss@sourceware.org
Subject: Re: [PATCH 0/6] MSVC fixes
Date: Fri, 23 Mar 2012 00:23:00 -0000	[thread overview]
Message-ID: <4F6BC278.30304@moxielogic.com> (raw)
In-Reply-To: <1332458731-15004-1-git-send-email-peda@lysator.liu.se>

On 3/22/2012 7:25 PM, Peter Rosin wrote:
> Hi!
>
> This series fixes a number of problems that MSVC has with libffi.

Thanks Peter.   Do you know if MS makes a Free-as-in-Beer MSVC distribution?

Thanks,

AG


>
> 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

  parent reply	other threads:[~2012-03-23  0:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 23:26 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 [this message]
2012-03-23  7:35   ` Peter Rosin
2012-03-23 10:03     ` Peter Rosin
2012-03-23 10:04       ` Peter Rosin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F6BC278.30304@moxielogic.com \
    --to=green@moxielogic.com \
    --cc=libffi-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).