From 3af00aec7f829d379b12e0f969796fcf739e11ac Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 3 Aug 2023 12:37:29 +0800 Subject: CryptoPkg/openssl: move compiler_flags to buildinf.c Seems with openssl 3.0 this is used by multiple source files, so we get duplicate symbol errors when linking. Fix that by moving compiler_flags from header file to a source file. Signed-off-by: Gerd Hoffmann Cc: Jiewen Yao Cc: Xiaoyu Lu Cc: Guomin Jiang Reviewed-by: Jiewen Yao Acked-by: Ard Biesheuvel Tested-by: Ard Biesheuvel Tested-by: Brian J. Johnson Tested-by: Kenneth Lautner --- CryptoPkg/Library/OpensslLib/OpensslLib.inf | 1 + CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf | 1 + CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 1 + CryptoPkg/Library/OpensslLib/OpensslLibFull.inf | 1 + CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf | 1 + CryptoPkg/Library/OpensslLib/buildinf.c | 4 ++++ CryptoPkg/Library/OpensslLib/buildinf.h | 2 +- 7 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 CryptoPkg/Library/OpensslLib/buildinf.c (limited to 'CryptoPkg') diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf index 9c922d0f49..d43806708a 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf @@ -34,6 +34,7 @@ # Autogenerated files list starts here # Autogenerated files list ends here buildinf.h + buildinf.c ossl_store.c rand_pool.c # SslNull.c diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf index e6f2b8e07b..54cf01279c 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf @@ -36,6 +36,7 @@ # Autogenerated files list starts here # Autogenerated files list ends here buildinf.h + buildinf.c ossl_store.c rand_pool.c # SslNull.c diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf index c7e63ca16c..3037eba9d3 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf @@ -35,6 +35,7 @@ # Autogenerated files list starts here # Autogenerated files list ends here buildinf.h + buildinf.c ossl_store.c rand_pool.c SslNull.c diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf b/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf index 8dffe936fc..f9c00605f2 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf @@ -39,6 +39,7 @@ # Autogenerated files list starts here # Autogenerated files list ends here buildinf.h + buildinf.c ossl_store.c rand_pool.c # SslNull.c diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf b/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf index e8ebf6afb7..7ba262cb01 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf @@ -41,6 +41,7 @@ # Autogenerated files list starts here # Autogenerated files list ends here buildinf.h + buildinf.c ossl_store.c rand_pool.c # SslNull.c diff --git a/CryptoPkg/Library/OpensslLib/buildinf.c b/CryptoPkg/Library/OpensslLib/buildinf.c new file mode 100644 index 0000000000..cd7fe9322e --- /dev/null +++ b/CryptoPkg/Library/OpensslLib/buildinf.c @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-2-Clause-Patent */ +#include "buildinf.h" + +const char *compiler_flags = "compiler: information not available from edk2"; diff --git a/CryptoPkg/Library/OpensslLib/buildinf.h b/CryptoPkg/Library/OpensslLib/buildinf.h index 9042c7526f..7cf0eae008 100644 --- a/CryptoPkg/Library/OpensslLib/buildinf.h +++ b/CryptoPkg/Library/OpensslLib/buildinf.h @@ -1,4 +1,4 @@ #define PLATFORM "UEFI" #define DATE "Fri Dec 22 01:23:45 PDT 2017" -const char *compiler_flags = "compiler: information not available from edk2"; +extern const char *compiler_flags; -- cgit v1.2.3