From 9e7b4311cb2c552271dbc7bc6e67b50493518a72 Mon Sep 17 00:00:00 2001 From: jief666 Date: Wed, 28 Oct 2020 20:11:50 +0300 Subject: [PATCH] Make gcc10 thinks it should keep gBuildIdGrepTag symbol. --- rEFIt_UEFI/Platform/Settings.cpp | 6 +++--- rEFIt_UEFI/Platform/Settings.h | 7 ++++--- rEFIt_UEFI/refit/menu.cpp | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index d4e4b2e80..b6a6ddc28 100644 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -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; diff --git a/rEFIt_UEFI/Platform/Settings.h b/rEFIt_UEFI/Platform/Settings.h index fcc0e7a14..38c72c254 100644 --- a/rEFIt_UEFI/Platform/Settings.h +++ b/rEFIt_UEFI/Platform/Settings.h @@ -16,8 +16,6 @@ // INPUT_ITEM MenuItem; //}; -extern const char* path_independant; - class HDA_OUTPUTS { public: @@ -811,7 +809,10 @@ extern CONST CHAR16 *gFirmwareRevision; extern CONST CHAR8* gRevisionStr; extern CONST CHAR8* gFirmwareBuildDate; extern CONST CHAR8* gBuildInfo; -extern const LString8 gBuildId; +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 diff --git a/rEFIt_UEFI/refit/menu.cpp b/rEFIt_UEFI/refit/menu.cpp index 883692f9f..d256a79ee 100644 --- a/rEFIt_UEFI/refit/menu.cpp +++ b/rEFIt_UEFI/refit/menu.cpp @@ -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");