From nobody Sat May 4 16:03:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56613+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56613+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1585558370; cv=none; d=zohomail.com; s=zohoarc; b=GCi6imhkoHbFgnveiJh5XobeZ9FMXQvIJnU20QXfGU2O/UEvFCImhWKJ1EcRqUELGS4RHL6RMXte3VyTqBrdvQNoa2fquJX8Dp4aG8jXkBhnKJvO21G8tPKx3TpwKSIReqYxrJ3QOtsf8xvw0fjTvrIvGfBr27wDHP1L0sen9rk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585558370; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=xb6pLmL+Ojx51ctPrMLGvZ5o4JnWX3ERrhF8mP6R/fk=; b=KHS6hkKp/9/9VJFvfE8TpZFnGLu2qSrI3JISX1ORjPbcH3pPE5xlK6rAh9jlX/g+PvMn73LjUck56x8QQg6XkYm+6LqE9e57EpAavxqSDadB8v2ecNSrnIbxWPRR2RcPmWsM6b5giy1YOH1X6aQky1Wek6q/UrGusJ1fj0Z5Mvk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56613+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 158555837090847.586719208207; Mon, 30 Mar 2020 01:52:50 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3mvzYY1788612xahoq7uRiNl; Mon, 30 Mar 2020 01:52:50 -0700 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.45953.1585558369964325863 for ; Mon, 30 Mar 2020 01:52:50 -0700 IronPort-SDR: qi01TJ9jMG52Nq6xDlx2+sK7cEf5Ve3oA2sDVUh8XJK3beFb48wyUslaDOPSfLEa4frCKeagGm AuuFpcM+hsUw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 01:52:49 -0700 IronPort-SDR: IFWFa++kqgiVm7TiGaiV7WdMBOt77pzoRJMNEwQb+Mkr+br76OUwNkCtWcz82qzYqgnhUanRAN sY6GAcAMdA9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,323,1580803200"; d="scan'208";a="448197610" X-Received: from guominji-mobl.ccr.corp.intel.com ([10.238.5.173]) by fmsmga005.fm.intel.com with ESMTP; 30 Mar 2020 01:52:47 -0700 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Jian J Wang , Xiaoyu Lu Subject: [edk2-devel] [PATCH] CryptoPkg/FltUsedLib: Add FltUsedLib for float. Date: Mon, 30 Mar 2020 16:52:47 +0800 Message-Id: <20200330085247.2415-1-guomin.jiang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,guomin.jiang@intel.com X-Gm-Message-State: eFEBA6pWyTNhcw3VIQKnKEwDx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1585558370; bh=yIe3cvYPYoX12Dh6McA7vC1viSquVOW3NuNwAPDZqhU=; h=Cc:Date:From:Reply-To:Subject:To; b=xDOA3+tkzI28Y0azJ2QnFvVQ7WyCQFnSBG9Mxd9Kg1uq3Owtlu2bpJlxq8eOxzL83QZ AsjKqfhN1tVQbXJFOqYxTnCk8CacLDWGjecIk9wvcMCIke54exKvk8SKU3Tnhx7yFQpeB 7Dmi6a8V7HEsk30ItOcJHJHJkpqdXnqfQVs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2596 OpenSSL requires _fltused to be defined as a constant anywhere floating point is used. This is to satisfy the linker, however, it is possible to compile a module with multiple definitions of fltused. This causes the MSVC compiler to fail the build. To solve this problem, the FltUsedLib was created that is one spot that the global static can exist. Cc: Jian J Wang Cc: Xiaoyu Lu Signed-off-by: Guomin Jiang Reviewed-by: Bret Barkelew --- CryptoPkg/CryptoPkg.dsc | 2 ++ .../Library/BaseCryptLib/BaseCryptLib.inf | 1 + .../Library/BaseCryptLib/PeiCryptLib.inf | 1 + .../Library/BaseCryptLib/RuntimeCryptLib.inf | 1 + .../Library/BaseCryptLib/SmmCryptLib.inf | 1 + CryptoPkg/Library/FltUsedLib/FltUsedLib.c | 14 ++++++++ CryptoPkg/Library/FltUsedLib/FltUsedLib.inf | 33 +++++++++++++++++++ CryptoPkg/Library/TlsLib/TlsLib.inf | 1 + 8 files changed, 54 insertions(+) create mode 100644 CryptoPkg/Library/FltUsedLib/FltUsedLib.c create mode 100644 CryptoPkg/Library/FltUsedLib/FltUsedLib.inf diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc index 4cb37b1349..e9854087b5 100644 --- a/CryptoPkg/CryptoPkg.dsc +++ b/CryptoPkg/CryptoPkg.dsc @@ -97,6 +97,7 @@ IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf = #??? OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + FltUsedLib|CryptoPkg/Library/FltUsedLib/FltUsedLib.inf SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf =20 [LibraryClasses.ARM] @@ -232,6 +233,7 @@ CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + CryptoPkg/Library/FltUsedLib/FltUsedLib.inf CryptoPkg/Library/TlsLib/TlsLib.inf CryptoPkg/Library/TlsLibNull/TlsLibNull.inf CryptoPkg/Library/OpensslLib/OpensslLib.inf diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Li= brary/BaseCryptLib/BaseCryptLib.inf index 1bbe4f435a..c82e703aa0 100644 --- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf @@ -84,6 +84,7 @@ DebugLib OpensslLib IntrinsicLib + FltUsedLib PrintLib =20 # diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf b/CryptoPkg/Lib= rary/BaseCryptLib/PeiCryptLib.inf index c836c257f8..342aad008c 100644 --- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf @@ -78,6 +78,7 @@ DebugLib OpensslLib IntrinsicLib + FltUsedLib =20 # # Remove these [BuildOptions] after this library is cleaned up diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf b/CryptoPkg= /Library/BaseCryptLib/RuntimeCryptLib.inf index bff308a4f5..dcf209d7f5 100644 --- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf @@ -89,6 +89,7 @@ DebugLib OpensslLib IntrinsicLib + FltUsedLib PrintLib =20 # diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf b/CryptoPkg/Lib= rary/BaseCryptLib/SmmCryptLib.inf index cc0b65fd25..7fdaaa48a6 100644 --- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf @@ -88,6 +88,7 @@ MemoryAllocationLib OpensslLib IntrinsicLib + FltUsedLib PrintLib =20 # diff --git a/CryptoPkg/Library/FltUsedLib/FltUsedLib.c b/CryptoPkg/Library/= FltUsedLib/FltUsedLib.c new file mode 100644 index 0000000000..8f2487ea13 --- /dev/null +++ b/CryptoPkg/Library/FltUsedLib/FltUsedLib.c @@ -0,0 +1,14 @@ +/** @file + Need include this when use floats. + + Copyright (C) Microsoft Corporation. All rights reserved.
+ Copyright (c) 2020, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +// +// You need to include this to let the compiler know we are going to use +// floating point +// +int _fltused =3D 0x9875; diff --git a/CryptoPkg/Library/FltUsedLib/FltUsedLib.inf b/CryptoPkg/Librar= y/FltUsedLib/FltUsedLib.inf new file mode 100644 index 0000000000..8d67eadfa5 --- /dev/null +++ b/CryptoPkg/Library/FltUsedLib/FltUsedLib.inf @@ -0,0 +1,33 @@ +## @file +# It is depent on when using floats +# +# Copyright (C) Microsoft Corporation. All rights reserved.
+# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D FltUsedLib + FILE_GUID =3D C004F180-9FE2-4D2B-8318-BADC2A231774 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D FltUsedLib + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 AARCH64 +# + +[Sources] + FltUsedLib.c + +[Packages] + MdePkg/MdePkg.dec + +[BuildOptions] + # Disable GL due to linker error LNK1237 + # https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker= -tools-error-lnk1237?view=3Dvs-2017 + MSFT:*_*_*_CC_FLAGS =3D /GL- diff --git a/CryptoPkg/Library/TlsLib/TlsLib.inf b/CryptoPkg/Library/TlsLib= /TlsLib.inf index 2f3ce695c3..febbdf5149 100644 --- a/CryptoPkg/Library/TlsLib/TlsLib.inf +++ b/CryptoPkg/Library/TlsLib/TlsLib.inf @@ -37,6 +37,7 @@ BaseMemoryLib DebugLib IntrinsicLib + FltUsedLib MemoryAllocationLib OpensslLib SafeIntLib --=20 2.25.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56613): https://edk2.groups.io/g/devel/message/56613 Mute This Topic: https://groups.io/mt/72648022/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-