public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* RE : Build Error after adding GLOBAL_REMOVE_IF_UNREFERENCED in CryptoPkg's CryptTs.c file
@ 2023-01-18  7:19 Sountharya N
  0 siblings, 0 replies; only message in thread
From: Sountharya N @ 2023-01-18  7:19 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: Prarthana Sagar V, Srinivasan Mani

[-- Attachment #1: Type: text/plain, Size: 2941 bytes --]

Hi,



We are facing Build error in Old platforms after adding GLOBAL_REMOVE_IF_UNREFERENCED in CryptoPkg's CryptTs.c file in edk202211 tag.



GLOBAL_REMOVE_IF_UNREFERENCED macro is defined in MdePkg/Include/Base.h

//

// The Microsoft* C compiler can removed references to unreferenced data items

//  if the /OPT:REF linker option is used. We defined a macro as this is a

//  a non standard extension

//

#if defined (_MSC_VER) && _MSC_VER < 1800 && !defined (MDE_CPU_EBC)

///

/// Remove global variable from the linked image if there are no references to

/// it after all compiler and linker optimizations have been performed.

///

///

#define GLOBAL_REMOVE_IF_UNREFERENCED  __declspec(selectany)

#else

///

/// Remove the global variable from the linked image if there are no references

///  to it after all compiler and linker optimizations have been performed.

///

///

#define GLOBAL_REMOVE_IF_UNREFERENCED

#endif



Facing Below Build Error:

Building ... d:\bakerville\crypto\5.14_bakerville_0acjf044\MdePkg\Library\DxeServicesLib\DxeServicesLib.inf [X64]
d:\bakerville\crypto\5.14_bakerville_0acjf044\CryptoPkg\Library\BaseCryptLib\Pk\CryptTs.c(58) : error C2496: 'TS_MESSAGE_IMPRINT_new' : 'selectany' can only be applied to data items with external linkage
d:\bakerville\crypto\5.14_bakerville_0acjf044\CryptoPkg\Library\BaseCryptLib\Pk\CryptTs.c(89) : error C2496: 'TS_ACCURACY_new' : 'selectany' can only be applied to data items with external linkage
d:\bakerville\crypto\5.14_bakerville_0acjf044\CryptoPkg\Library\BaseCryptLib\Pk\CryptTs.c(141) : error C2496: 'TS_TST_INFO_new' : 'selectany' can only be applied to data items with external linkage
NMAKE : fatal error U1077: 'F:\Tools\WINDDK\7600.16385.1\bin\x86\amd64\cl.exe' : return code '0x2'
Stop.
AmiFlashLibCommon.c
Assembling: d:\bakerville\crypto\5.14_bakerville_0acjf044\Build\YubaCity\RELEASE_MYTOOLS\X64\AmiCompatibilityPkg\Library\AmiDxeLib\OUTPUT\x64\x64AsmLib\GetCpuTimer.iii



build...
: error 7000: Failed to execute command
    nmake.exe /nologo -s tbuild [d:\bakerville\crypto\5.14_bakerville_0acjf044\Build\YubaCity\RELEASE_MYTOOLS\X64\CryptoPkg\Library\BaseCryptLib\BaseCryptLib]



After commenting GLOBAL_REMOVE_IF_UNREFERENCED macro in CryptTs.c file, project builds successfully. Kindly, provide your comments.

Thanks,
Sountharya
-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.

[-- Attachment #2: Type: text/html, Size: 19609 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-18  7:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-18  7:19 RE : Build Error after adding GLOBAL_REMOVE_IF_UNREFERENCED in CryptoPkg's CryptTs.c file Sountharya N

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