回复: [edk2-devel] GCC49 DEBUG AARCH64 and ARM builds use -O0

gaoliming gaoliming at byosoft.com.cn
Wed Apr 14 01:09:51 UTC 2021


Ard:

> -----邮件原件-----
> 发件人: devel at edk2.groups.io <devel at edk2.groups.io> 代表 Ard
> Biesheuvel
> 发送时间: 2021年4月14日 0:37
> 收件人: Rebecca Cran <rebecca at nuviainc.com>
> 抄送: Laszlo Ersek <lersek at redhat.com>; edk2-devel-groups-io
> <devel at edk2.groups.io>; Leif Lindholm <leif at nuviainc.com>; Liming Gao
> (Byosoft address) <gaoliming at byosoft.com.cn>; Ard Biesheuvel
> <ardb+tianocore at kernel.org>
> 主题: Re: [edk2-devel] GCC49 DEBUG AARCH64 and ARM builds use -O0
> 
> On Tue, 13 Apr 2021 at 14:12, Rebecca Cran <rebecca at nuviainc.com> wrote:
> >
> > +Ard (with the correct email address)
> >
> > On 4/13/21 4:32 AM, Laszlo Ersek wrote:
> > > +Liming
> > >
> > > On 04/12/21 17:10, Rebecca Cran wrote:
> > >> I noticed the GCC49 (and GCC48) AARCH64 and ARM DEBUG builds use
> -O0,
> > >> unlike IA32 and X64 platforms which build with -Os.
> > >>
> > >> e.g. from
> > >>
> https://github.com/tianocore/edk2/blob/master/BaseTools/Conf/tools_def.te
> mplate
> > >> :
> > >>
> > >> DEBUG_GCC49_AARCH64_CC_FLAGS     =
> DEF(GCC49_AARCH64_CC_FLAGS) -O0
> > >>
> > >> Is that deliberate, or should it be like X64 where DEBUG builds are
> > >> optimized and NOOPT is used when unoptimized binaries are needed?
> > >>
> > >
> > > Seems to go back to commit dafe0fedc508 ("BaseTools: Add GCC49
> > > toolchain; align data sections to 0x40", 2014-07-28). My guess is that
> > > in 2014, gcc (4.9) may have had issues with arm64 code generation with
> -Os.
> > >
> > > You hint at DEBUG_GCC48_AARCH64_CC_FLAGS too, which seems like a
> > > promising clue at first -- because, perhaps the GCC49 flags in the
> > > above-mentioned commit had simply been modeled on the then-existent
> > > GCC48 ones.
> > >
> > > Unfortunately however, the GCC48 entry appeared in the
> > > less-than-helpfully-explained commit 2bc3256ca6d4 ("Sync BaseTool trunk
> > > (version r2640) into EDKII BaseTools.", 2014-01-10).
> > >
> > > Thanks
> > > Laszlo
> > >
> >
> 
> IIRC we only added NOOPT for ARM much later, and at that time, we
> decided to leave GCC49 alone.
> 

If no special reason, DEBUG_GCC49_AARCH64 can be updated from -O0 to -Os like GCC49_IA32 and GCC49_X64. 

Thanks
Liming
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74066): https://edk2.groups.io/g/devel/message/74066
Mute This Topic: https://groups.io/mt/82081073/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list