From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43255 invoked by alias); 26 Feb 2018 11:15:48 -0000 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 Received: (qmail 43123 invoked by uid 89); 26 Feb 2018 11:15:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-7.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=desperate, H*Ad:U*libffi-discuss, H*r:sk:libffi-, love X-HELO: mail-lf0-f53.google.com Received: from mail-lf0-f53.google.com (HELO mail-lf0-f53.google.com) (209.85.215.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Feb 2018 11:15:31 +0000 Received: by mail-lf0-f53.google.com with SMTP id o145so18396820lff.0 for ; Mon, 26 Feb 2018 03:15:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=z26+gwJytYLCm71zojAl7I28uFxq676MHKRpj/6VSI0=; b=ap43qj2BaNcO4W8Gc3SixOyqqURjyDrUSUnPxfWDjOQQ3qpxRCECAmMS7teX/x5ZTb bBJ3LkoTbRu357ea1i8NvLuU0veLUeUGoOUxu5lOT7+qH56R3rxywaL8dG3cg5E/RWda DXeoZuhzNyYQ5b7nCS8bdUw/c5FwxcQu5qBa9uuc2arBRcj9R8e+X57MYAbrPsdprRXC pbUgMCa0pXNr49Uq4DiK9hDzQKkOVsunQKD3sYkDDCC8WEuuBOKl/zQyOjg1tdey3Ed9 pdK7o7NE/CWLW7n4GqEbVRmwrgG8P0FCZ1ewvYGwR7KTJws7O0kRGOjbRCZM4Y/1BSrV WpCQ== X-Gm-Message-State: APf1xPCjfdh8xn+GOp8qp8jWFmZAEN986NyeeKC0BqOOr+JXVpsGb854 DHYIuwoZ1ibIM/OEYKjP1aIGZDP6xeK7KZZ9Pe+uzQ== X-Google-Smtp-Source: AG47ELu9eCgtPebhmejPrd2QsJ/TqAR38it9MeX18eBll3TWadogbOfWSPvE8c5OMQtopcn8NdY7L45YpxoYtf/X9hM= X-Received: by 10.25.242.68 with SMTP id d4mr8031278lfk.51.1519643726342; Mon, 26 Feb 2018 03:15:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.38.209 with HTTP; Mon, 26 Feb 2018 03:15:25 -0800 (PST) In-Reply-To: <163cd931d34d07e248fa49b9a836a213@xoru.net> References: <163cd931d34d07e248fa49b9a836a213@xoru.net> From: Anthony Green Date: Mon, 26 Feb 2018 11:15:00 -0000 Message-ID: Subject: Re: Building the latest LibFFI for Windows To: lua@xoru.net Cc: libffi-discuss@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018/txt/msg00007.txt.bz2 Hi Bas, My suggestion is to only work with the git sources right now. 32-bit builds with the MS tools should still work. Could you open a issue on github with the console output of that build attempt? I may also need to see config.log if it was created. Thanks! AG On Thu, Feb 8, 2018 at 4:48 PM, Bas Groothedde wrote: > > > Hi there list! > > First of all, I hope that this list is still active. I'm trying to learn > more about the libffi source in the hopes of utilising it and hopefully > contributing to this project. > > I encountered a problem with libffi-3.2.1, build with msvc 2017 in > cygwin from source (sourceware.org:/pub/libffi/libffi-3.2.1.tar.gz [1]). > With a little tweaking in the build script I managed to get a nice > static x86 and x64 library build of libffi. Wonderful! > > I was then happily using the library until I encountered that on x86 > Windows, the stdcall ABI in closures are a bit grumpy. Using the ABI in > callbacks for Windows API calls, like EnumChildWindows, crashes the > program and raises a 'Stack overflow' exception. > > This is a massive problem for me, as one of the biggest reasons I'm > using libffi is to support API access from a scripting language. I have > seen many reports on this issue, and many possible fixes, however none > of the fixes I encountered seemed to work in the 3.2.1 sources I > downloaded. > > If anyone has a fix for that version, I'd love to have it; as it > successfully builds with msvc on x86 and x64 platforms. > > The next thing I tried in my desperate quest for a solution is to fetch > the latest version of the libffi source of GitHub, and try to compile > that with my cygwin / msvc setup. (I need the Windows build to be a > static library produced by msvc) - however to my surprise the x64 build > went very well, but the x86 build yields an 'platform not supported' > error. Is there any way I can still build with msvc for x86, or am I > lost completely here? Building with mingw or gcc causes issues in the > software the library is going to be linked in, due to the fact a newer > standard library is linked (which is not available in that software). > > Thanks for your time, and hopefully someone will understand what my > rambling is about. > > Cheers! > Bas > -- > > ------------------------- > > Bas Groothedde > Imagine Programming > > Links: > ------ > [1] ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz