[edk2-devel] [PATCH 16/24] CryptoPkg/openssl: move compiler_flags to buildinf.c

Gerd Hoffmann kraxel at redhat.com
Fri Dec 3 16:07:40 UTC 2021


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 <kraxel at redhat.com>
---
 CryptoPkg/Library/OpensslLib/OpensslLib.inf             | 1 +
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf       | 1 +
 CryptoPkg/Library/OpensslLib/OpensslLibX64.inf          | 1 +
 CryptoPkg/Library/OpensslLib/OpensslLibX64Gcc.inf       | 1 +
 CryptoPkg/Library/OpensslLib/buildinf.h                 | 2 +-
 CryptoPkg/Library/OpensslLib/{buildinf.h => buildinf.c} | 3 +--
 6 files changed, 6 insertions(+), 3 deletions(-)
 copy CryptoPkg/Library/OpensslLib/{buildinf.h => buildinf.c} (50%)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 54e67e2aed26..03eacbff0b92 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -886,6 +886,7 @@ [Sources]
   $(OPENSSL_PATH)/ssl/statem/statem_local.h
 # Autogenerated files list ends here
   buildinf.h
+  buildinf.c
   ossl_store.c
   rand_pool.c
 
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index f385008e01fa..0a0c8ed6affc 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -834,6 +834,7 @@ [Sources]
   $(OPENSSL_PATH)/providers/implementations/storemgmt/file_store_local.h
 # Autogenerated files list ends here
   buildinf.h
+  buildinf.c
   ossl_store.c
   rand_pool.c
 
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
index b92feaf1bffe..20bb0b5ecbce 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
@@ -586,6 +586,7 @@ [Sources.X64]
   $(OPENSSL_PATH)/ssl/statem/statem_local.h
 # Autogenerated files list ends here
   buildinf.h
+  buildinf.c
   ossl_store.c
   rand_pool.c
   X64/ApiHooks.c
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64Gcc.inf b/CryptoPkg/Library/OpensslLib/OpensslLibX64Gcc.inf
index 4ffdd8cd06d3..f2f942083c46 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibX64Gcc.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64Gcc.inf
@@ -586,6 +586,7 @@ [Sources.X64]
   $(OPENSSL_PATH)/ssl/statem/statem_local.h
 # Autogenerated files list ends here
   buildinf.h
+  buildinf.c
   ossl_store.c
   rand_pool.c
   X64/ApiHooks.c
diff --git a/CryptoPkg/Library/OpensslLib/buildinf.h b/CryptoPkg/Library/OpensslLib/buildinf.h
index b840c8656a28..e25436e8f21a 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;
diff --git a/CryptoPkg/Library/OpensslLib/buildinf.h b/CryptoPkg/Library/OpensslLib/buildinf.c
similarity index 50%
copy from CryptoPkg/Library/OpensslLib/buildinf.h
copy to CryptoPkg/Library/OpensslLib/buildinf.c
index b840c8656a28..aa6320f720ef 100644
--- a/CryptoPkg/Library/OpensslLib/buildinf.h
+++ b/CryptoPkg/Library/OpensslLib/buildinf.c
@@ -1,4 +1,3 @@
-#define PLATFORM  "UEFI"
-#define DATE      "Fri Dec 22 01:23:45 PDT 2017"
+#include "buildinf.h"
 
 const char * compiler_flags = "compiler: information not available from edk2";
-- 
2.33.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#84317): https://edk2.groups.io/g/devel/message/84317
Mute This Topic: https://groups.io/mt/87479970/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list