From: "Ni, Ray" <ray.ni@intel.com>
To: LiuYu <liuyu@greatwall.com.cn>,
"Justen, Jordan L" <jordan.l.justen@intel.com>,
"afish@apple.com" <afish@apple.com>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>
Subject: Re: [edk2-devel][PATCH] EmulatorPkg/Unix Prevents the compiler form optimizing unused variable
Date: Fri, 25 Sep 2020 08:59:32 +0000 [thread overview]
Message-ID: <BY5PR11MB4007D3032BDA4BA3C55C19E68C360@BY5PR11MB4007.namprd11.prod.outlook.com> (raw)
In-Reply-To: <f899ba18d2f4adf6394887a0661e1600a376d714.1601005909.git.liuyu@greatwall.com.cn>
Jordan, Andrew,
I will defer to you to review the patch.
Thanks,
Ray
> -----Original Message-----
> From: LiuYu <liuyu@greatwall.com.cn>
> Sent: Friday, September 25, 2020 1:49 PM
> To: Justen, Jordan L <jordan.l.justen@intel.com>; afish@apple.com; Ni, Ray <ray.ni@intel.com>
> Cc: devel@edk2.groups.io; LiuYu <liuyu@greatwall.com.cn>
> Subject: [edk2-devel][PATCH] EmulatorPkg/Unix Prevents the compiler form optimizing unused variable
>
> 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 <liuyu@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
prev parent reply other threads:[~2020-09-25 8:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 5:48 [edk2-devel][PATCH] EmulatorPkg/Unix Prevents the compiler form optimizing unused variable Yu Liu
2020-09-25 8:59 ` Ni, Ray [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BY5PR11MB4007D3032BDA4BA3C55C19E68C360@BY5PR11MB4007.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox