From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23469 invoked by alias); 23 Mar 2012 00:23:39 -0000 Received: (qmail 23446 invoked by uid 22791); 23 Mar 2012 00:23:38 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,TW_BF X-Spam-Check-By: sourceware.org Received: from mail-iy0-f169.google.com (HELO mail-iy0-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Mar 2012 00:23:24 +0000 Received: by iajr24 with SMTP id r24so4697630iaj.0 for ; Thu, 22 Mar 2012 17:23:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=P6HjCU2EL9SPwqisbQr192Ebbg/0Cfn23Umb4rIVvjM=; b=Hn9ZaUyJ6N8c65DO7py7gkjPWXk/kdaARf3Sn03QWkJM7dSCbGxccDepU9/f6Bn1al TN+D0Ez5/9WIsmLKOMj8Fi2U/Qqymjga4QMwn2d9PXEzA905JJ1ajwbbh9WttJ8n/zYF 1t0MVjanaTaH33Ve6tpCvzlu0aLaeqnZV+AbowOnbnYd/FemGOrinFP1g+v+OtUhXgCM DhJUE8BAVnErfZAtX4TCojnkUllywraVt4XBj/lW/kH9Pf4Dp37i5FK3ww+Q6JuibPW6 kinFLZzEcEtyOhzQhNk9FgruyE4Xq/P7rSFXdkqlytvZuT1QPlqADozHt57fMLkd5tnp f0hg== Received: by 10.50.41.168 with SMTP id g8mr604790igl.17.1332462204117; Thu, 22 Mar 2012 17:23:24 -0700 (PDT) Received: from [192.168.1.139] (bas3-toronto06-1177890090.dsl.bell.ca. [70.53.45.42]) by mx.google.com with ESMTPS id dl10sm3460248igb.9.2012.03.22.17.23.22 (version=SSLv3 cipher=OTHER); Thu, 22 Mar 2012 17:23:23 -0700 (PDT) Message-ID: <4F6BC278.30304@moxielogic.com> Date: Fri, 23 Mar 2012 00:23:00 -0000 From: Anthony Green User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120312 Thunderbird/11.0 MIME-Version: 1.0 To: libffi-discuss@sourceware.org Subject: Re: [PATCH 0/6] MSVC fixes References: <1332458731-15004-1-git-send-email-peda@lysator.liu.se> In-Reply-To: <1332458731-15004-1-git-send-email-peda@lysator.liu.se> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnT/QNI7+SWFgAi5TGIa6MAT8PNtLktjGRe0JKz1AtXvlfqIYo6f3Umx4/Th4ih9Zpucckd 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/msg00142.txt.bz2 On 3/22/2012 7:25 PM, Peter Rosin wrote: > Hi! > > This series fixes a number of problems that MSVC has with libffi. Thanks Peter. Do you know if MS makes a Free-as-in-Beer MSVC distribution? Thanks, AG > > The first patches are pretty mechanic, but the last one adds a > new ABI for x86-win32. As it happens, Microsoft and GCC does not > agree on the details of the cdecl calling convention when they > are returning structures (at least). MS thinks that the caller > pops the hidden structure return address and GCC thinks that > the callee should do it. And MS relies on the callee to return > the structure return address in eax, while GCC seems to not care > about that (which is pretty sane, the compiler should be able > to keep track och where it did put that structure after all). > > With the patches the testsuite behaves *much* better for MSVC. > What still fails is return_uc.c (crashes, but works when running > in the debugger), struct1_win32.c, struct2_win32.c (haven't > really looked, they crash) and closure_thiscall.c (no support for > using __thiscall from C apparently). And both the C++ tests fail > (haven't looked at all). > > It would be interesting to see if MSVC can call into a libffi > built by GCC and vice versa, to check if the structure return > discrepancy really is fixed. That should be possible if I did > this right, right? > > Cheers, > Peter > > [PATCH 1/6] Put declarations before statements, C89 style > [PATCH 2/6] Add kludge for missing format specifiers on MSVC > [PATCH 3/6] Remove surplus frame from MASM function entry > [PATCH 4/6] Use __fastcall for MSVC > [PATCH 5/6] Translate inline assembly to MSVC format > [PATCH 6/6] Add Microsoftian variant of the cdecl ABI