From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web08.193.1618331805159364929 for ; Tue, 13 Apr 2021 09:36:45 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yq1DjTGM; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id 9B1F660720 for ; Tue, 13 Apr 2021 16:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618331803; bh=TFUdW5zplxmNDj8IeboP2GfhrJ3+3VPEw54z/XQ2AqE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Yq1DjTGMAlszW1rQAxm5mfj0EPUusB7SljpklHN2y+tHxb++mTtcJ+tu2K3Vn8/57 6VcyzVEzadrel0WxEIoakCfiZ4qUyhr4hBVzsJbfPGGc0EMqJMYgvOsX0SXzdg/O3K UbV8Ao9XlEaA/x1laZzjzph4p0HReOBSTMKOsfm2UXxvgwdo7u9/BHQO7a07QU0Fun XodPZ2oTvkmcnW06p0vrXxFGRGcnY8cD9smWLWTi71s/gJrMZGuRZsq6wvkN2ilvkD OKZAgf0VCPhLVL22haB+YGpRD/iURabc1cinyotVIGHvM1n+zn7ip1BlXzOIe9zE3z 7TBBgzhfUuNEA== Received: by mail-oi1-f176.google.com with SMTP id a21so4516003oib.10 for ; Tue, 13 Apr 2021 09:36:43 -0700 (PDT) X-Gm-Message-State: AOAM533z65u6F2QVUkOvsLbBFcK6KJfax3ocADE6kHBSLT6D4TxITCIb AG51moxGxaZ/vnwF1iaPkYVXBSVPx1qcNWkMQ04= X-Google-Smtp-Source: ABdhPJzu3G0X9FL1d4+r7i596A1KJnqEknVM7w50+dU+wQLgY0QimQOA4XRaKdySvKZDPcz+h4fDpvi2yR/6PXM8rMg= X-Received: by 2002:a05:6808:4c3:: with SMTP id a3mr598501oie.174.1618331803022; Tue, 13 Apr 2021 09:36:43 -0700 (PDT) MIME-Version: 1.0 References: <4a1d8554-a01f-4fc4-298f-efe73369547e@nuviainc.com> <13e8c66f-2282-7fcd-b9ea-07bb063bc635@redhat.com> <8d7b63bb-a143-c836-5689-b265e4c0a92b@nuviainc.com> In-Reply-To: <8d7b63bb-a143-c836-5689-b265e4c0a92b@nuviainc.com> From: "Ard Biesheuvel" Date: Tue, 13 Apr 2021 18:36:31 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] GCC49 DEBUG AARCH64 and ARM builds use -O0 To: Rebecca Cran Cc: Laszlo Ersek , edk2-devel-groups-io , Leif Lindholm , "Liming Gao (Byosoft address)" , Ard Biesheuvel Content-Type: text/plain; charset="UTF-8" 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: > > +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.template > >> : > >> > >> 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.