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

Gerd Hoffmann posted 22 patches 1 year, 5 months ago
[edk2-devel] [PATCH 13/22] CryptoPkg/openssl: move compiler_flags to buildinf.c
Posted by Gerd Hoffmann 1 year, 5 months ago
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@redhat.com>
---
 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/buildinf.h                 | 2 +-
 CryptoPkg/Library/OpensslLib/{buildinf.h => buildinf.c} | 4 ++--
 6 files changed, 7 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 57058d20d1db..b92b1daf2096 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -34,6 +34,7 @@ [Sources]
 # 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 899e243a6db6..59c5d42bc78e 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
@@ -37,6 +37,7 @@ [Sources]
 # 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 7b7650fc001f..c796effe23fd 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -35,6 +35,7 @@ [Sources]
 # 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 9309fe35fa38..aaea1bab5b26 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
@@ -39,6 +39,7 @@ [Sources]
 # 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.h b/CryptoPkg/Library/OpensslLib/buildinf.h
index 9042c7526fd6..7cf0eae008ed 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 9042c7526fd6..cd7fe9322ed4 100644
--- a/CryptoPkg/Library/OpensslLib/buildinf.h
+++ b/CryptoPkg/Library/OpensslLib/buildinf.c
@@ -1,4 +1,4 @@
-#define PLATFORM  "UEFI"
-#define DATE      "Fri Dec 22 01:23:45 PDT 2017"
+/* SPDX-License-Identifier: BSD-2-Clause-Patent */
+#include "buildinf.h"
 
 const char  *compiler_flags = "compiler: information not available from edk2";
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101069): https://edk2.groups.io/g/devel/message/101069
Mute This Topic: https://groups.io/mt/97576415/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-