From: "Gerd Hoffmann" <kraxel@redhat.com>
To: devel@edk2.groups.io
Cc: Jian J Wang <jian.j.wang@intel.com>,
Pawel Polawski <ppolawsk@redhat.com>,
Xiaoyu Lu <xiaoyu1.lu@intel.com>,
Ard Biesheuvel <ardb+tianocore@kernel.org>,
Guomin Jiang <guomin.jiang@intel.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Oliver Steffen <osteffen@redhat.com>,
Jordan Justen <jordan.l.justen@intel.com>
Subject: [PATCH 16/22] [hash] CryptoPkg/openssl: add OpensslLibHash.inf
Date: Mon, 13 Mar 2023 09:30:10 +0100 [thread overview]
Message-ID: <20230313083016.136448-17-kraxel@redhat.com> (raw)
In-Reply-To: <20230313083016.136448-1-kraxel@redhat.com>
Add *.inf variant with hash functions only,
to support SEC and PEI doing measurements.
I don't think we really need this, using OpensslLibCrypto.inf and
depending on the linker dropping unused object files should work
equally well. For trouble-shooting it's handy though because
you'll get linker errors instead of bloated binaries.
So not sure yet what to do with this ...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
.../Library/OpensslLib/OpensslLibHash.inf | 126 ++++++++++++++++++
1 file changed, 126 insertions(+)
create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibHash.inf
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibHash.inf b/CryptoPkg/Library/OpensslLib/OpensslLibHash.inf
new file mode 100644
index 000000000000..2d5838e682e9
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibHash.inf
@@ -0,0 +1,126 @@
+## @file
+# This module provides OpenSSL Library implementation with ECC and TLS
+# features removed and features have performance optimizations enabled.
+#
+# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = OpensslLibCrypto
+ MODULE_UNI_FILE = OpensslLibCrypto.uni
+ FILE_GUID = E29FC209-8B64-4500-BD20-AF4EAE47EA0E
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = OpensslLib
+
+ DEFINE OPENSSL_PATH = openssl
+ DEFINE OPENSSL_GEN_PATH = openssl-gen
+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DEDK2_OPENSSL_NOEC=1 -DOPENSSL_NO_ASM
+ DEFINE OPENSSL_FLAGS_NOASM =
+
+#
+# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+# Autogenerated files list starts here
+# Autogenerated files list ends here
+
+[Packages]
+ MdePkg/MdePkg.dec
+ CryptoPkg/CryptoPkg.dec
+
+[LibraryClasses]
+ BaseLib
+ DebugLib
+ RngLib
+
+[LibraryClasses.ARM]
+ ArmSoftFloatLib
+
+[BuildOptions]
+ #
+ # Disables the following Visual Studio compiler warnings brought by openssl source,
+ # so we do not break the build with /WX option:
+ # C4090: 'function' : different 'const' qualifiers
+ # C4132: 'object' : const object should be initialized (tls13_enc.c)
+ # C4210: nonstandard extension used: function given file scope
+ # C4244: conversion from type1 to type2, possible loss of data
+ # C4245: conversion from type1 to type2, signed/unsigned mismatch
+ # C4267: conversion from size_t to type, possible loss of data
+ # C4306: 'identifier' : conversion from 'type1' to 'type2' of greater size
+ # C4310: cast truncates constant value
+ # C4389: 'operator' : signed/unsigned mismatch (xxxx)
+ # C4700: uninitialized local variable 'name' used. (conf_sap.c(71))
+ # C4702: unreachable code
+ # C4706: assignment within conditional expression
+ # C4819: The file contains a character that cannot be represented in the current code page
+ #
+ MSFT:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) /wd4090 /wd4132 /wd4210 /wd4244 /wd4245 /wd4267 /wd4310 /wd4389 /wd4700 /wd4702 /wd4706 /wd4819
+ MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) /wd4090 /wd4132 /wd4210 /wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702 /wd4706 /wd4819
+
+ #
+ # Disable following Visual Studio 2015 compiler warnings brought by openssl source,
+ # so we do not break the build with /WX option:
+ # C4718: recursive call has no side effects, deleting
+ #
+ MSFT:*_VS2015x86_IA32_CC_FLAGS = /wd4718
+ MSFT:*_VS2015x86_X64_CC_FLAGS = /wd4718
+
+ INTEL:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) /w
+ INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) /w
+
+ #
+ # Suppress the following build warnings in openssl so we don't break the build with -Werror
+ # -Werror=maybe-uninitialized: there exist some other paths for which the variable is not initialized.
+ # -Werror=format: Check calls to printf and scanf, etc., to make sure that the arguments supplied have
+ # types appropriate to the format string specified.
+ # -Werror=unused-but-set-variable: Warn whenever a local variable is assigned to, but otherwise unused (aside from its declaration).
+ #
+ GCC:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable
+ GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable -DNO_MSABI_VA_FUNCS
+ GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable
+ GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable -Wno-error=format
+ GCC:*_*_RISCV64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable
+ GCC:*_*_LOONGARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable
+ GCC:*_CLANG35_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized
+ GCC:*_CLANG38_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized
+ GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized -Wno-error=incompatible-pointer-types -Wno-error=pointer-sign -Wno-error=implicit-function-declaration -Wno-error=ignored-pragma-optimize
+
+ # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:
+ # 1295: Deprecated declaration <entity> - give arg types
+ # 550: <entity> was set but never used
+ # 1293: assignment in condition
+ # 111: statement is unreachable (invariably "break;" after "return X;" in case statement)
+ # 68: integer conversion resulted in a change of sign ("if (Status == -1)")
+ # 177: <entity> was declared but never referenced
+ # 223: function <entity> declared implicitly
+ # 144: a value of type <type> cannot be used to initialize an entity of type <type>
+ # 513: a value of type <type> cannot be assigned to an entity of type <type>
+ # 188: enumerated type mixed with another type (i.e. passing an integer as an enum without a cast)
+ # 1296: Extended constant initialiser used
+ # 128: loop is not reachable - may be emitted inappropriately if code follows a conditional return
+ # from the function that evaluates to true at compile time
+ # 546: transfer of control bypasses initialization - may be emitted inappropriately if the uninitialized
+ # variable is never referenced after the jump
+ # 1: ignore "#1-D: last line of file ends without a newline"
+ # 3017: <entity> may be used before being set (NOTE: This was fixed in OpenSSL 1.1 HEAD with
+ # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.)
+ XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized
+ XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized
+
+ #
+ # AARCH64 uses strict alignment and avoids SIMD registers for code that may execute
+ # with the MMU off. This involves SEC, PEI_CORE and PEIM modules as well as BASE
+ # libraries, given that they may be included into such modules.
+ # This library, even though of the BASE type, is never used in such cases, and
+ # avoiding the SIMD register file (which is shared with the FPU) prevents the
+ # compiler from successfully building some of the OpenSSL source files that
+ # use floating point types, so clear the flags here.
+ #
+ GCC:*_*_AARCH64_CC_XIPFLAGS ==
--
2.39.2
next prev parent reply other threads:[~2023-03-13 8:30 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 8:29 [PATCH 00/22] [edk2-staging] CryptoPkg/openssl: switch to openssl-3.0 Gerd Hoffmann
2023-03-13 8:29 ` [PATCH 01/22] CryptoPkg/openssl: update submodule to openssl-3.0.8 Gerd Hoffmann
2023-03-13 15:13 ` [edk2-devel] " Li, Yi
2023-03-14 8:16 ` Gerd Hoffmann
2023-03-14 8:45 ` Ard Biesheuvel
2023-03-14 9:04 ` Gerd Hoffmann
2023-06-02 2:53 ` Yao, Jiewen
2023-06-02 9:14 ` Ard Biesheuvel
2023-06-02 14:29 ` Yao, Jiewen
2023-06-19 8:12 ` Gerd Hoffmann
2023-06-19 8:37 ` Li, Yi
2023-08-03 4:40 ` Li, Yi
2023-03-13 8:29 ` [PATCH 02/22] CryptoPkg/openssl: remove openssl 1.1.1 header files Gerd Hoffmann
2023-03-13 8:29 ` [PATCH 03/22] CryptoPkg/openssl: remove generated file lists Gerd Hoffmann
2023-03-13 8:29 ` [PATCH 04/22] CryptoPkg/openssl: add openssl3 configure scripts Gerd Hoffmann
2023-03-13 8:29 ` [PATCH 05/22] CryptoPkg/openssl: UefiAsm.conf update for openssl 3.0, add aarch64 Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 06/22] CryptoPkg/openssl: update Openssl*.inf files for openssl 3.0 Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 07/22] CryptoPkg/BaseCryptLib: no openssl deprecation warnings please Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 08/22] CryptoPkg/BaseCryptLib; adapt CryptSm3.c to openssl 3.0 changes Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 09/22] CryptoPkg/BaseCryptLib: drop BIO_* dummy functions Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 10/22] CryptoPkg/TlsLib: ERR_GET_FUNC is gone Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 11/22] CryptoPkg/TlsLib: use unsigned long for ErrorCode Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 12/22] CryptoPkg/openssl: adapt rand_pool.c to openssl 3.0 changes Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 13/22] CryptoPkg/openssl: move compiler_flags to buildinf.c Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 14/22] CryptoPkg/openssl: store dummy update for openssl 3.0 Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 15/22] CryptoPkg/openssl: adapt EcSm2Null.c " Gerd Hoffmann
2023-03-13 8:30 ` Gerd Hoffmann [this message]
2023-03-13 15:46 ` [edk2-devel] [PATCH 16/22] [hash] CryptoPkg/openssl: add OpensslLibHash.inf Li, Yi
2023-03-14 7:45 ` Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 17/22] [hash] OvmfPkg: wire up OpensslLibHash.inf Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 18/22] [provider] CryptoPkg/openssl: use our own predefined providers Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 19/22] CryptoPkg/openssl: update *.inf, add generated files Gerd Hoffmann
2023-03-13 15:26 ` [edk2-devel] " Li, Yi
2023-03-14 7:55 ` Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 20/22] CryptoPkg/openssl: update CI config for openssl 3.0 Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 21/22] CryptoPkg/openssl: cleanup remaining openssl-1.1.1 files Gerd Hoffmann
2023-03-13 8:30 ` [PATCH 22/22] CryptoPkg/openssl: update HOWTO file Gerd Hoffmann
2023-06-01 16:40 ` [edk2-devel] [PATCH 00/22] [edk2-staging] CryptoPkg/openssl: switch to openssl-3.0 Michael D Kinney
2023-06-02 2:51 ` Yao, Jiewen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230313083016.136448-17-kraxel@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox