gInXcode is only used by GDB script and if optimization is turned on then compiler treats this variable as unused so it can't been linked in the final object.
Signed-off-by: LiuYu <li...@greatwall.com.cn> --- EmulatorPkg/Unix/Host/Host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EmulatorPkg/Unix/Host/Host.c b/EmulatorPkg/Unix/Host/Host.c index b4e5510613..b851264c8e 100644 --- a/EmulatorPkg/Unix/Host/Host.c +++ b/EmulatorPkg/Unix/Host/Host.c @@ -54,7 +54,7 @@ IMAGE_CONTEXT_TO_MOD_HANDLE *mImageContextModHandleArray = NULL; EFI_PEI_PPI_DESCRIPTOR *gPpiList; -int gInXcode = 0; +int gInXcode __attribute__((used)) = 0; /*++ -- 2.20.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#65607): https://edk2.groups.io/g/devel/message/65607 Mute This Topic: https://groups.io/mt/77074006/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-