Make gcc10 thinks it should keep gBuildIdGrepTag symbol.

This commit is contained in:
jief666 2020-10-28 20:11:50 +03:00
parent a23e29cc65
commit 9e7b4311cb
3 changed files with 9 additions and 7 deletions

View File

@ -133,15 +133,15 @@ CONST CHAR8* gFirmwareBuildDate = "unknown";
CONST CHAR8* gBuildInfo = NULL;
#endif
#ifdef BUILD_ID
const LString8 gBuildId __attribute__((used)) = "Clover build id: " BUILD_ID;
const LString8 gBuildId __attribute__((used)) = BUILD_ID;
const LString8 gBuildIdGrepTag __attribute__((used)) = "CloverBuildIdGrepTag: " BUILD_ID;
#else
const LString8 gBuildId __attribute__((used)) = "Clover build id: " "unknown";
const LString8 gBuildId __attribute__((used)) = "unknown";
const LString8 gBuildIdGrepTag __attribute__((used)) = "CloverBuildIdGrepTag: " "unknown";
#endif
// __attribute__((used)) seems to not always work. So, in AboutRefit(), there is a trick to let the compiler thinks it's used.
const char* path_independant __attribute__((used)) = "path_independant";
const LString8 path_independant __attribute__((used)) = "path_independant";
EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl = NULL;

View File

@ -16,8 +16,6 @@
// INPUT_ITEM MenuItem;
//};
extern const char* path_independant;
class HDA_OUTPUTS
{
public:
@ -812,6 +810,9 @@ extern CONST CHAR8* gRevisionStr;
extern CONST CHAR8* gFirmwareBuildDate;
extern CONST CHAR8* gBuildInfo;
extern const LString8 gBuildId;
extern const LString8 path_independant;
extern const LString8 gBuildIdGrepTag;
extern BOOLEAN ResumeFromCoreStorage;
extern BOOLEAN gRemapSmBiosIsRequire; // syscl: pass argument for Dell SMBIOS here

View File

@ -1091,7 +1091,8 @@ void AboutRefit(void)
if ( "unknown"_XS8 != LString8(gRevisionStr) ) AboutMenu.AddMenuInfo_f("%s", gRevisionStr);
if ( "unknown"_XS8 != LString8(gFirmwareBuildDate) ) AboutMenu.AddMenuInfo_f(" Build: %s", gFirmwareBuildDate);
if ( "unknown"_XS8 != gBuildId ) AboutMenu.AddMenuInfo_f(" Build id: %s", gBuildId.c_str());
AboutMenu.AddMenuInfo_f("%s", path_independant); // trick to let the compiler think path_independant is used and must be kept in binary.
AboutMenu.AddMenuInfo_f("%s", path_independant.c_str()); // trick to let the compiler think path_independant is used and must be kept in binary.
AboutMenu.Entries[AboutMenu.Entries.size()-1].Title.SWPrintf("%s", gBuildIdGrepTag.c_str());
AboutMenu.Entries[AboutMenu.Entries.size()-1].Title.SWPrintf(" ");
AboutMenu.AddMenuInfo_f("Based on rEFIt (c) 2006-2010 Christoph Pfisterer");
AboutMenu.AddMenuInfo_f("Portions Copyright (c) Intel Corporation");