From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29730 invoked by alias); 9 Nov 2012 12:48:44 -0000 Received: (qmail 29717 invoked by uid 22791); 9 Nov 2012 12:48:43 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,TW_BF,TW_KK X-Spam-Check-By: sourceware.org Received: from blu0-omc3-s9.blu0.hotmail.com (HELO blu0-omc3-s9.blu0.hotmail.com) (65.55.116.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Nov 2012 12:48:39 +0000 Received: from BLU0-SMTP109 ([65.55.116.73]) by blu0-omc3-s9.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 9 Nov 2012 04:48:36 -0800 X-EIP: [VZgY7NNuuUQ12oR1BU+KszBOVddzPH/K] Message-ID: Received: from [192.168.0.4] ([2.25.10.49]) by BLU0-SMTP109.blu0.hotmail.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 9 Nov 2012 04:48:35 -0800 Date: Fri, 09 Nov 2012 12:48:00 -0000 From: Daniel Holden User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: libffi-discuss@sourceware.org Subject: Re: Building on Mingw64 References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org X-SW-Source: 2012/txt/msg00272.txt.bz2 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=20 the same issue I was getting when using Python ctypes. I will have to=20 investigate a bit more before I have an idea of what exactly is going on=20 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=20 program crashes and in the stack-trace is a call to a completely=20 unrelated function in my library. I will try to get my head around what=20 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 > 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 -Iinclu= de >> -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=3Dx86_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=3D#!topic/rubyinstaller/Lp-Ou= kkdGQE > > 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=E9ry > >