public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: "Grégory Pakosz" <gpakosz@myscript.com>,
	"libffi-discuss@sourceware.org" <libffi-discuss@sourceware.org>
Cc: "nield.a.d@gmail.com" <nield.a.d@gmail.com>,
	       "rth@twiddle.net" <rth@twiddle.net>
Subject: Re: libffi 3.2.1 and master, can't build with Visual Studio 2012
Date: Tue, 18 Nov 2014 16:02:00 -0000	[thread overview]
Message-ID: <546B6D7D.9010804@redhat.com> (raw)
In-Reply-To: <1416324204734.161@myscript.com>

On 11/18/2014 04:23 PM, Grégory Pakosz wrote:
> ​Hello,
> 
> I would like to inform you it's not possible to build libffi 3.2.1 with Visual Studio 2012 anymore as it's not a C99 compiler.
> 
> In src/x86/ffi.c, 
> 
>   - src/x86/ffi.c doesn't compile because
>     - commit 098dca6b31e declares "size_t z" variables not at the beginning of blocks which is possible in C99 only
>     - commit 5d6340ef2cf8 moves "int i" variable declaration from beginning to middle of block
>     - this appears to be fixed in master by commit b21ec1ce783​ though

These are simply oversights that can easily be fixed.

> static const struct abi_params abi_params[FFI_LAST_ABI] = {
>   [FFI_SYSV] = { 1, 0 },
>   [FFI_THISCALL] = { 1, 1, { R_ECX } },
>   [FFI_FASTCALL] = { 1, 2, { R_ECX, R_EDX } },
>   [FFI_STDCALL] = { 1, 0 },
>   [FFI_PASCAL] = { -1, 0 },
>   [FFI_REGISTER] = { -1, 3, { R_EAX, R_EDX, R_ECX } },
>   [FFI_MS_CDECL] = { 1, 0 }
> };

This one's tricky, without simply forcing X86 an X86_WIN32 to have the same
ffi_abi enumeration.  Currently, while they have the same symbols, the symbols
have different values.  So *not* using designated initializers is hard.

I suppose we could fill in the values at runtime from a switch statement,
but read-only data appeals to me...

And all of that's moot without re-porting the assembly back to masm, which I
was not looking forward to doing.

I have downloaded the recently released gratis VS 2013 Community, but I havn't
yet looked into it enough to figure out how to actually do things with it.
Do I really have to create some sort of project to get things to build, or
is there a command-line compiler included?

How are you building libffi with VS?


r~

  reply	other threads:[~2014-11-18 16:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-18 15:23 Grégory Pakosz
2014-11-18 16:02 ` Richard Henderson [this message]
2014-11-18 17:14   ` Grégory Pakosz
2015-04-21 18:15     ` Grégory Pakosz

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=546B6D7D.9010804@redhat.com \
    --to=rth@redhat.com \
    --cc=gpakosz@myscript.com \
    --cc=libffi-discuss@sourceware.org \
    --cc=nield.a.d@gmail.com \
    --cc=rth@twiddle.net \
    /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).