Re: GCC49 DEBUG AARCH64 and ARM builds use -O0

Ard Biesheuvel

On Tue, 13 Apr 2021 at 14:12, Rebecca Cran <> wrote:

+Ard (with the correct email address)

On 4/13/21 4:32 AM, Laszlo Ersek wrote:

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


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).

IIRC we only added NOOPT for ARM much later, and at that time, we
decided to leave GCC49 alone.

Join to automatically receive all group messages.