BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603
With this change, global variable _fltused will not be removed by LTO
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based\r
Cryptographic Library.\r
\r
Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based\r
Cryptographic Library.\r
\r
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
typedef UINTN size_t;\r
\r
\r
typedef UINTN size_t;\r
\r
+#if defined(__GNUC__) || defined(__clang__)\r
+ #define GLOBAL_USED __attribute__((used))\r
+#else\r
+ #define GLOBAL_USED\r
+#endif\r
+\r
/* OpenSSL will use floating point support, and C compiler produces the _fltused\r
symbol by default. Simply define this symbol here to satisfy the linker. */\r
/* OpenSSL will use floating point support, and C compiler produces the _fltused\r
symbol by default. Simply define this symbol here to satisfy the linker. */\r
+int GLOBAL_USED _fltused = 1;\r
\r
/* Sets buffers to a specified character */\r
void * memset (void *dest, int ch, size_t count)\r
\r
/* Sets buffers to a specified character */\r
void * memset (void *dest, int ch, size_t count)\r