This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building on Mingw64


Hi,

Many Thanks - that managed to get it to compile.

I set up a small test program again and now I believe I have encountered the same issue I was getting when using Python ctypes. I will have to investigate a bit more before I have an idea of what exactly is going on but there is some very odd stuff and I may have found a bug.

For example upon calling the troublesome function using the ffi my program crashes and in the stack-trace is a call to a completely unrelated function in my library. I will try to get my head around what is happening and post a more detailed breakdown soon.

- Dan

On 09/11/2012 12:04, Luis Lavena wrote:
On Fri, Nov 9, 2012 at 8:56 AM, Daniel Holden
<theonlydancingbanana@hotmail.com> wrote:
Hi all,

I'm having a little trouble building libffi on Windows 7 64 bit using
Mingw64 (http://mingw-w64.sourceforge.net/).

Here is the error message on compile:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude
-I..
src -DFFI_BUILDING -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -MT
sr
/x86/win32.lo -MD -MP -MF src/x86/.deps/win32.Tpo -c ../src/x86/win32.S
-DDLL_
XPORT -DPIC -o src/x86/.libs/win32.o
../src/x86/win32.S: Assembler messages:
../src/x86/win32.S:486: Error: invalid instruction suffix for `push'
../src/x86/win32.S:497: Error: invalid instruction suffix for `push'
../src/x86/win32.S:498: Error: invalid instruction suffix for `push'
../src/x86/win32.S:643: Error: invalid instruction suffix for `pop'
../src/x86/win32.S:652: Error: invalid instruction suffix for `push'
../src/x86/win32.S:669: Error: invalid instruction suffix for `push'
../src/x86/win32.S:768: Error: invalid instruction suffix for `pop'
../src/x86/win32.S:780: Error: invalid instruction suffix for `pop'
../src/x86/win32.S:797: Error: invalid instruction suffix for `push'
../src/x86/win32.S:799: Error: invalid instruction suffix for `push'
../src/x86/win32.S:814: Error: invalid instruction suffix for `push'
../src/x86/win32.S:818: Error: invalid instruction suffix for `push'
../src/x86/win32.S:918: Error: invalid instruction suffix for `pop'
../src/x86/win32.S:919: Error: invalid instruction suffix for `pop'
../src/x86/win32.S:934: Error: invalid instruction suffix for `push'
../src/x86/win32.S:1032: Error: invalid instruction suffix for `pop'
make[3]: *** [src/x86/win32.lo] Error 1

I know very little about assembly but this looks like a 32/64 bit issue. Is
MinGW64 supported as a compiler?

Did you use the configure script and provided the host?

configure --host=x86_64-w64-mingw32?

Because that is required to enable the 64bits mode on my end.

I've compiled libffi in 64bits mode without troubles with mingw-w64
compiler, see binary packages mentioned here:

https://groups.google.com/forum/?fromgroups=#!topic/rubyinstaller/Lp-OukkdGQE

The 64bits version was obtained using tdm64 variant of mingw-w64, but
is mingw-w64 at the end. The trick is always configure with the right
host flag.

Let us know if that helps.
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]