From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web11.7675.1585657944286793570 for ; Tue, 31 Mar 2020 05:32:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GraGI72F; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585657943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AktXzvbN7AxvmpGTzIOliHiXO59fxuPkHKiYGWFfo1U=; b=GraGI72FygLahSlDeGUc/kKDGqRFj914kXWYdi/uY54YDqqkJdrs71xq1uqFqa4u4xVIor XumQEELLeJM+XeuqnZk0zncHIlgRhdSkV2rZEnCERfxZP0LgtMr4Tb+BBbmMKpZdLtUwbn ZSoVpbOfnGBNgI9ExPslZSB2fIznqJI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-123-Y0y9H3K5O5G-z2pefLf8bA-1; Tue, 31 Mar 2020 08:32:19 -0400 X-MC-Unique: Y0y9H3K5O5G-z2pefLf8bA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C26611005509; Tue, 31 Mar 2020 12:32:17 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-131.ams2.redhat.com [10.36.115.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id F20B610372C0; Tue, 31 Mar 2020 12:32:15 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] CryptoPkg/FltUsedLib: Add FltUsedLib for float. To: Ard Biesheuvel , "Jiang, Guomin" Cc: "devel@edk2.groups.io" , "Wang, Jian J" , "Lu, XiaoyuX" , "Yao, Jiewen" , Sean Brogan , "macarl@microsoft.com" References: <20200330085247.2415-1-guomin.jiang@intel.com> <03f18a49-6bd6-e753-e1bf-7e061d13f200@redhat.com> From: "Laszlo Ersek" Message-ID: <200ff4c9-5cf5-2a74-1003-bbc36e58d450@redhat.com> Date: Tue, 31 Mar 2020 14:32:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 03/31/20 09:13, Ard Biesheuvel wrote: > On Tue, 31 Mar 2020 at 03:40, Jiang, Guomin wrote: >> >> Hi Laszlo, >> >> Thanks for you spending time review the changes. >> >> And I just want to present how to reproduce the build error. >> >> When build OvmfPkgX64, you can encounter this issue with your local change. The error as below: >> TcgPei.lib(AutoGen.obj) : error LNK2001: unresolved external symbol _fltused >> c:\sourcecodes\tiano\Build\OvmfX64\DEBUG_VS2019\X64\SecurityPkg\Tcg\TcgPei\TcgPei\DEBUG\TcgPei.dll : fatal error LNK1120: 1 unresolved externals >> >> The build command: build -p OvmfPkg\OvmfPkgX64.dsc -b DEBUG -t VS2019 -a X64 -D TPM_ENABLE >> The code changes for reproducing this symptom: >> - int GLOBAL_USED _fltused = 1; >> + //int GLOBAL_USED _fltused = 1; >> The machine: WIN10 >> The branch: edk2 master >> > > Doesn't the build error go away as well if you simply add FloatUsed.c > to all BaseCryptLib flavours if Visual Studio is being used? > > Something like > > diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > index 1bbe4f435aec..f40bf18e7f5d 100644 > --- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > +++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > @@ -27,6 +27,7 @@ [Defines] > # > > [Sources] > + FloatUsed.c | MSFT > InternalCryptLib.h > Hash/CryptMd4.c > Hash/CryptMd5.c > This is *exactly* what I've had in mind! (With the additional (optional) tweak that IMO "FloatUsed.c" belongs with the openssl INF files, as those are where the floating point usage originates from. The cryptlib instances themselves have no floating point code, AIUI.) Thanks Laszlo