public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Define the unique _fltused in BaseLib
@ 2020-04-28  7:01 Guomin Jiang
  2020-04-28  7:01 ` [PATCH v3 1/2] MdePkg/BaseLib: Add _fltused to feed MSVC compiler Guomin Jiang
  2020-04-28  7:01 ` [PATCH v3 2/2] CryptoPkg/IntrinsicLib: Remove _fltused to avoid duplication Guomin Jiang
  0 siblings, 2 replies; 3+ messages in thread
From: Guomin Jiang @ 2020-04-28  7:01 UTC (permalink / raw)
  To: devel

Out of edk2 may need _fltused and may confict with edk2, define the
unique to provide the _fltused and expect to avoid build error result by
missing _fltused symbol

Guomin Jiang (2):
  MdePkg/BaseLib: Add _fltused to feed MSVC compiler
  CryptoPkg/IntrinsicLib: Remove _fltused to avoid duplication

 CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c | 12 +-----------
 MdePkg/Library/BaseLib/BaseLib.inf                |  3 ++-
 MdePkg/Library/BaseLib/FltUsed.c                  | 14 ++++++++++++++
 3 files changed, 17 insertions(+), 12 deletions(-)
 create mode 100644 MdePkg/Library/BaseLib/FltUsed.c

-- 
2.25.1.windows.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v3 1/2] MdePkg/BaseLib: Add _fltused to feed MSVC compiler
  2020-04-28  7:01 [PATCH v3 0/2] Define the unique _fltused in BaseLib Guomin Jiang
@ 2020-04-28  7:01 ` Guomin Jiang
  2020-04-28  7:01 ` [PATCH v3 2/2] CryptoPkg/IntrinsicLib: Remove _fltused to avoid duplication Guomin Jiang
  1 sibling, 0 replies; 3+ messages in thread
From: Guomin Jiang @ 2020-04-28  7:01 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2596

Out of edk2 may need _fltused symbol such as mu_plus
OnScreenKeyboard and UiToolKit. those driver will define the symbol to
feed MSVC, but it will conflict with CryptoPkg. so move the symbol to
BaseLib.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 MdePkg/Library/BaseLib/BaseLib.inf |  3 ++-
 MdePkg/Library/BaseLib/FltUsed.c   | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 MdePkg/Library/BaseLib/FltUsed.c

diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/BaseLib.inf
index 3586beb0ab..bab31c07c7 100644
--- a/MdePkg/Library/BaseLib/BaseLib.inf
+++ b/MdePkg/Library/BaseLib/BaseLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Base Library implementation.
 #
-#  Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>
 #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
 #  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
 #
@@ -60,6 +60,7 @@
   String.c
   FilePaths.c
   BaseLibInternals.h
+  FltUsed.c               | MSFT
 
 [Sources.Ia32]
   Ia32/WriteTr.nasm
diff --git a/MdePkg/Library/BaseLib/FltUsed.c b/MdePkg/Library/BaseLib/FltUsed.c
new file mode 100644
index 0000000000..c065594266
--- /dev/null
+++ b/MdePkg/Library/BaseLib/FltUsed.c
@@ -0,0 +1,14 @@
+/** @file
+  Declare _fltused symbol for MSVC
+
+  MSVC need this symbol for float, andd it here to feed MSVC. it may remove
+  if MSVC not need it any more.
+
+  Copyright (c) 2020 - 2020, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+//
+// Just for MSVC float
+//
+int _fltused = 0x1;
-- 
2.25.1.windows.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v3 2/2] CryptoPkg/IntrinsicLib: Remove _fltused to avoid duplication
  2020-04-28  7:01 [PATCH v3 0/2] Define the unique _fltused in BaseLib Guomin Jiang
  2020-04-28  7:01 ` [PATCH v3 1/2] MdePkg/BaseLib: Add _fltused to feed MSVC compiler Guomin Jiang
@ 2020-04-28  7:01 ` Guomin Jiang
  1 sibling, 0 replies; 3+ messages in thread
From: Guomin Jiang @ 2020-04-28  7:01 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Xiaoyu Lu

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2596

Out of edk2 may need _fltused symbol such as mu_plus
OnScreenKeyboard and UiToolKit. those driver will define the symbol to
feed MSVC, but it will conflict with CryptoPkg. so move the symbol to
BaseLib.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
---
 CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
index 94fe341bec..c4136916d0 100644
--- a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
+++ b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
@@ -2,7 +2,7 @@
   Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based
   Cryptographic Library.
 
-Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -13,16 +13,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 typedef UINTN  size_t;
 
-#if defined(__GNUC__) || defined(__clang__)
-  #define GLOBAL_USED __attribute__((used))
-#else
-  #define GLOBAL_USED
-#endif
-
-/* OpenSSL will use floating point support, and C compiler produces the _fltused
-   symbol by default. Simply define this symbol here to satisfy the linker. */
-int  GLOBAL_USED _fltused = 1;
-
 /* Sets buffers to a specified character */
 void * memset (void *dest, int ch, size_t count)
 {
-- 
2.25.1.windows.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-28  7:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-28  7:01 [PATCH v3 0/2] Define the unique _fltused in BaseLib Guomin Jiang
2020-04-28  7:01 ` [PATCH v3 1/2] MdePkg/BaseLib: Add _fltused to feed MSVC compiler Guomin Jiang
2020-04-28  7:01 ` [PATCH v3 2/2] CryptoPkg/IntrinsicLib: Remove _fltused to avoid duplication Guomin Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox