public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Why do we use -g option of gcc even for RELEASE build?
@ 2017-11-08  2:25 Heyi Guo
  2017-11-08 14:53 ` Laszlo Ersek
  2017-11-08 15:49 ` Paolo Bonzini
  0 siblings, 2 replies; 5+ messages in thread
From: Heyi Guo @ 2017-11-08  2:25 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: Zhu, Yonghong, Gao, Liming

Hi folks,

 From gcc manual, -g option seems to produce debugging information. In 
tools_def.template, -g is included in GCC_ALL_CC_FLAGS, so it will also 
be enabled for RELEASE build with gcc tool chain. Any special reason to 
do that?

Thanks and regards,

Heyi



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why do we use -g option of gcc even for RELEASE build?
  2017-11-08  2:25 Why do we use -g option of gcc even for RELEASE build? Heyi Guo
@ 2017-11-08 14:53 ` Laszlo Ersek
  2017-11-08 15:32   ` Gao, Liming
  2017-11-08 15:49 ` Paolo Bonzini
  1 sibling, 1 reply; 5+ messages in thread
From: Laszlo Ersek @ 2017-11-08 14:53 UTC (permalink / raw)
  To: Heyi Guo, edk2-devel@lists.01.org; +Cc: Gao, Liming

On 11/08/17 03:25, Heyi Guo wrote:
> Hi folks,
> 
> From gcc manual, -g option seems to produce debugging information. In
> tools_def.template, -g is included in GCC_ALL_CC_FLAGS, so it will also
> be enabled for RELEASE build with gcc tool chain. Any special reason to
> do that?

In the edk2 tree, -g was added to GCC_ALL_CC_FLAGS and
GCC44_ALL_CC_FLAGS in commit 52302d4dee58 ("Sync EDKII BaseTools to
BaseTools project r1903.", 2010-02-28).

If you check the history of the now-historical separate BaseTools
project <https://github.com/tianocore/buildtools-BaseTools.git>, "-g"
was introduced in commit 46c1e64305d4 ("Upgrade the binutil 2.18.50.0.5
to 2.20.51.0.5 for UNIXGCC tool chain", 2010-02-25).

I guess that the same <Command.GCC> for [Dynamic-Library-File] must be
able to work for both DEBUG/NOOPT and RELEASE builds. So -g is included
for all of those build targets, in the C flags. Ultimately the debug
symbols are not copied into the .efi binaries, for RELEASE, I believe.

Thanks
Laszlo


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why do we use -g option of gcc even for RELEASE build?
  2017-11-08 14:53 ` Laszlo Ersek
@ 2017-11-08 15:32   ` Gao, Liming
  2017-11-09  0:44     ` Heyi Guo
  0 siblings, 1 reply; 5+ messages in thread
From: Gao, Liming @ 2017-11-08 15:32 UTC (permalink / raw)
  To: Laszlo Ersek, Heyi Guo, edk2-devel@lists.01.org

In build_rule.txt, GCC built image will be strip first, then be converted to EFI image by GenFw. There is no symbol in the final EFI image. All symbols are kept into original GCC built image. 

Thanks
Liming
> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]
> Sent: Wednesday, November 8, 2017 10:54 PM
> To: Heyi Guo <heyi.guo@linaro.org>; edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: Re: [edk2] Why do we use -g option of gcc even for RELEASE build?
> 
> On 11/08/17 03:25, Heyi Guo wrote:
> > Hi folks,
> >
> > From gcc manual, -g option seems to produce debugging information. In
> > tools_def.template, -g is included in GCC_ALL_CC_FLAGS, so it will also
> > be enabled for RELEASE build with gcc tool chain. Any special reason to
> > do that?
> 
> In the edk2 tree, -g was added to GCC_ALL_CC_FLAGS and
> GCC44_ALL_CC_FLAGS in commit 52302d4dee58 ("Sync EDKII BaseTools to
> BaseTools project r1903.", 2010-02-28).
> 
> If you check the history of the now-historical separate BaseTools
> project <https://github.com/tianocore/buildtools-BaseTools.git>, "-g"
> was introduced in commit 46c1e64305d4 ("Upgrade the binutil 2.18.50.0.5
> to 2.20.51.0.5 for UNIXGCC tool chain", 2010-02-25).
> 
> I guess that the same <Command.GCC> for [Dynamic-Library-File] must be
> able to work for both DEBUG/NOOPT and RELEASE builds. So -g is included
> for all of those build targets, in the C flags. Ultimately the debug
> symbols are not copied into the .efi binaries, for RELEASE, I believe.
> 
> Thanks
> Laszlo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why do we use -g option of gcc even for RELEASE build?
  2017-11-08  2:25 Why do we use -g option of gcc even for RELEASE build? Heyi Guo
  2017-11-08 14:53 ` Laszlo Ersek
@ 2017-11-08 15:49 ` Paolo Bonzini
  1 sibling, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2017-11-08 15:49 UTC (permalink / raw)
  To: Heyi Guo, edk2-devel@lists.01.org

On 08/11/2017 03:25, Heyi Guo wrote:
> From gcc manual, -g option seems to produce debugging information. In
> tools_def.template, -g is included in GCC_ALL_CC_FLAGS, so it will also
> be enabled for RELEASE build with gcc tool chain. Any special reason to
> do that?

Why *not* actually?  Debug information only costs disk space, it is not
part of the firmware image (and even for native Linux binaries it is not
loaded in memory).

Paolo


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why do we use -g option of gcc even for RELEASE build?
  2017-11-08 15:32   ` Gao, Liming
@ 2017-11-09  0:44     ` Heyi Guo
  0 siblings, 0 replies; 5+ messages in thread
From: Heyi Guo @ 2017-11-09  0:44 UTC (permalink / raw)
  To: Gao, Liming, Laszlo Ersek, edk2-devel@lists.01.org, pbonzini

That makes sense. Thank you all :)

Regards,

Heyi


在 11/8/2017 11:32 PM, Gao, Liming 写道:
> In build_rule.txt, GCC built image will be strip first, then be converted to EFI image by GenFw. There is no symbol in the final EFI image. All symbols are kept into original GCC built image.
>
> Thanks
> Liming
>> -----Original Message-----
>> From: Laszlo Ersek [mailto:lersek@redhat.com]
>> Sent: Wednesday, November 8, 2017 10:54 PM
>> To: Heyi Guo <heyi.guo@linaro.org>; edk2-devel@lists.01.org
>> Cc: Gao, Liming <liming.gao@intel.com>
>> Subject: Re: [edk2] Why do we use -g option of gcc even for RELEASE build?
>>
>> On 11/08/17 03:25, Heyi Guo wrote:
>>> Hi folks,
>>>
>>>  From gcc manual, -g option seems to produce debugging information. In
>>> tools_def.template, -g is included in GCC_ALL_CC_FLAGS, so it will also
>>> be enabled for RELEASE build with gcc tool chain. Any special reason to
>>> do that?
>> In the edk2 tree, -g was added to GCC_ALL_CC_FLAGS and
>> GCC44_ALL_CC_FLAGS in commit 52302d4dee58 ("Sync EDKII BaseTools to
>> BaseTools project r1903.", 2010-02-28).
>>
>> If you check the history of the now-historical separate BaseTools
>> project <https://github.com/tianocore/buildtools-BaseTools.git>, "-g"
>> was introduced in commit 46c1e64305d4 ("Upgrade the binutil 2.18.50.0.5
>> to 2.20.51.0.5 for UNIXGCC tool chain", 2010-02-25).
>>
>> I guess that the same <Command.GCC> for [Dynamic-Library-File] must be
>> able to work for both DEBUG/NOOPT and RELEASE builds. So -g is included
>> for all of those build targets, in the C flags. Ultimately the debug
>> symbols are not copied into the .efi binaries, for RELEASE, I believe.
>>
>> Thanks
>> Laszlo



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-09  0:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-08  2:25 Why do we use -g option of gcc even for RELEASE build? Heyi Guo
2017-11-08 14:53 ` Laszlo Ersek
2017-11-08 15:32   ` Gao, Liming
2017-11-09  0:44     ` Heyi Guo
2017-11-08 15:49 ` Paolo Bonzini

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