From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8B37321BC6A7F for ; Mon, 27 Mar 2017 02:42:12 -0700 (PDT) Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Mon, 27 Mar 2017 11:42:10 +0200 Received: from GaryWorkstation (nwb-a10-snat.microfocus.com [10.120.13.201]) by emea4-mta.ukb.novell.com with ESMTP (TLS encrypted); Mon, 27 Mar 2017 10:41:51 +0100 Date: Mon, 27 Mar 2017 17:41:45 +0800 From: Gary Lin To: Qin Long Cc: edk2-devel@lists.01.org, ting.ye@intel.com, jiaxin.wu@intel.com, lersek@redhat.com, ard.biesheuvel@linaro.org, ronald.cron@arm.com, Moso.Lee@citrix.com, thomas.palmer@hpe.com, David Woodhouse Message-ID: <20170327094145.whriwwc4mgaqhf6i@GaryWorkstation> References: <20170323131932.6168-1-qin.long@intel.com> <20170323131932.6168-7-qin.long@intel.com> MIME-Version: 1.0 In-Reply-To: <20170323131932.6168-7-qin.long@intel.com> User-Agent: Mutt/1.6.2 (2016-07-01) Subject: Re: [PATCH v2 06/11] CryptoPkg: Fix handling of &strcmp function pointers X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 09:42:13 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Mar 23, 2017 at 09:19:27PM +0800, Qin Long wrote: > In a couple of places, OpenSSL code uses the address of the > strcmp() function, and assigns it to another comparator function > pointer. > > Unfortunately, this falls foul of the inconsistent function ABI > that we use in EDKII. We '#define strcmp AsciiStrCmp' but AsciiStrCmp > is an EFIAPI function with the Microsoft ABI. And we're assigning its > address to a non-EFIAPI function, which may well have a different ABI. > > Fix this by providing an actual strcmp() function in the default ABI. > We already *had* a prototype for it in OpenSslSupport.h, which was > then superseded by the #define strcmp AsciiStrCmp. > > Now, OpenSSL code *can* use &strcmp without problems. > > Cc: Ting Ye > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Gary Lin > Cc: Ronald Cron > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: David Woodhouse > Signed-off-by: Qin Long I tested OVMF and it works for me. Tested-by: Gary Lin Gary Lin