Quantcast

Is libffi expected to work?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is libffi expected to work?

Paul Moore-2
I notice that libffi is provided with mingw. This was a bit of a
(pleasant!) surprise to me, as I understood libffi to be difficult to
get working on Win32. I have some 3rd party code which uses libffi, that
I wanted to try.

The code compiled OK, although ffi.h includes ffitarget.h which is not
in the include path, so I needed to add
-IMingw\lib\gcc\mingw32\3.4.5\include\libffi, which worried me a little.

When I tried the compiled code, it crashed. At the moment, I don't know
if the crash is in the 3rd party code, or mingw's libffi, or caused by
me getting the compile commands completely wrong. But before I go
delving into code that I don't know, and which is prerry complex, I
thought I'd just check if I should even be expecting this to work.

So should libffi "just work" with mingw? And if so, how come ffitarget.h
is not automatically included (is that a simple bug, or something
symptomatic of a worse issue)?

Thanks,
Paul.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is libffi expected to work?

Brian Dessent
Paul Moore wrote:

> So should libffi "just work" with mingw? And if so, how come ffitarget.h
> is not automatically included (is that a simple bug, or something
> symptomatic of a worse issue)?

I believe what you're using is the libffi that is internally part of
gcc's libjava implementation.  AFAIK this is only meant to be used by
libjava and not as a general purpose library.  On the other hand, java
does work -- at least to the limited extent allowed by the very old 3.4
version (i.e. static linking only, no indirect dispatch) -- and so it
must work on some level.

Brian

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is libffi expected to work?

Tor Lillqvist
FWIW, I also have a build of libffi (3.0.6) for Win32 at
http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libffi_3.0.6-1_win32.zip
and http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libffi-dev_3.0.6-1_win32.zip
. I haven't tested it extensively (the test suite uses tools which are
"exotic" on Windows), but it seems to work for what I needed it
(gobject-introspection).

--tml

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is libffi expected to work?

Paul Moore-2
Tor Lillqvist wrote:
> FWIW, I also have a build of libffi (3.0.6) for Win32 at
> http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libffi_3.0.6-1_win32.zip
> and http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libffi-dev_3.0.6-1_win32.zip
> . I haven't tested it extensively (the test suite uses tools which are
> "exotic" on Windows), but it seems to work for what I needed it
> (gobject-introspection).

Thanks, I'll give it a try. I need it for the "Alien" FFI extension for
Lua. The Alien source comes with a version (taken from Python's ctypes,
I believe) which has been hacked to work with MSVC, but doesn't work
with mingw.

I'll give yours a go.

Thanks,
Paul.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is libffi expected to work?

Paul Moore-2
In reply to this post by Brian Dessent
Brian Dessent wrote:

> Paul Moore wrote:
>
>> So should libffi "just work" with mingw? And if so, how come ffitarget.h
>> is not automatically included (is that a simple bug, or something
>> symptomatic of a worse issue)?
>
> I believe what you're using is the libffi that is internally part of
> gcc's libjava implementation.  AFAIK this is only meant to be used by
> libjava and not as a general purpose library.  On the other hand, java
> does work -- at least to the limited extent allowed by the very old 3.4
> version (i.e. static linking only, no indirect dispatch) -- and so it
> must work on some level.

Ah, that would explain why it needs some minor hacking (fftarget) to get
it working for general use. As it's not intended for general purpose
use, that may explain my problems.

Tor Lillqvist pointed me at an alternative version, I'll give that a go.

Paul.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Loading...