From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web08.5297.1621573647250513882 for ; Thu, 20 May 2021 22:07:28 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 21 May 2021 13:07:21 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Sergei Dmitrouk'" , "'Bob Feng'" , "'Ard Biesheuvel'" References: <20210519022704.309-1-gaoliming@byosoft.com.cn> <4750f3f7-b558-e46d-4977-d8cd8ef24039@redhat.com> <006701d74d21$130da5c0$3928f140$@byosoft.com.cn> <82b59f06-8b89-07cc-b426-fde56247389b@redhat.com> In-Reply-To: <82b59f06-8b89-07cc-b426-fde56247389b@redhat.com> Subject: =?UTF-8?B?5Zue5aSNOiDlm57lpI06IFtlZGsyLWRldmVsXSBbUEFUQ0hdIEJhc2VUb29sczogQWRkIC1mZmF0LWx0by1vYmplY3RzIG9wdGlvbiBpbiBHQ0M1IHRvb2wgY2hhaW4=?= Date: Fri, 21 May 2021 13:07:23 +0800 Message-ID: <003c01d74dff$2fa01ae0$8ee050a0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGAqyp9bNotfF0lGtSoQT8ENF699AFqyi8iAdB6bzICAbOws6twwATg Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Laszlo: Sure. I will include gcc issue link in the commit message. I will send V= 2 patch.=20 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io = =E4=BB=A3=E8=A1=A8 Laszlo Ersek > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B45=E6=9C=8820=E6=97=A5= 15:27 > =E6=94=B6=E4=BB=B6=E4=BA=BA: gaoliming ; devel= @edk2.groups.io > =E6=8A=84=E9=80=81: 'Sergei Dmitrouk' ; 'Bob Feng' > ; 'Ard Biesheuvel' > =E4=B8=BB=E9=A2=98: Re: =E5=9B=9E=E5=A4=8D: [edk2-devel] [PATCH] BaseToo= ls: Add -ffat-lto-objects option > in GCC5 tool chain >=20 > On 05/20/21 04:37, gaoliming wrote: > > Laszlo: > > Here is the discussion https://edk2.groups.io/g/devel/message/75299. > > Now, some uninitialized warning can't be detected on GCC5 tool chain= , > but can be detected on GCC49 tool chain. > > Edk2 CI only covers GCC5 tool chain. So, the merged code may impact > GCC49 build. > > I add this option to expose such uninitialized warning in GCC5 tool = chain > and increase GCC5 tool chain coverage. > > > > And, this is gcc issue > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90844 > > > > Yes. This change will expose some existing issues. I will include mo= re > detail in the commit message for this change. >=20 > Great, thanks for the info. >=20 > Can you please include the reference >=20 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90844 >=20 > in the commit message? >=20 > Acked-by: Laszlo Ersek >=20 > Thanks! > Laszlo >=20 > > > > Thanks > > Liming > >> -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > >> =E5=8F=91=E4=BB=B6=E4=BA=BA: Laszlo Ersek > >> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B45=E6=9C=8819=E6=97= = =A5 15:23 > >> =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; gaoliming@byosoft.= com.cn > >> =E6=8A=84=E9=80=81: Sergei Dmitrouk ; Bob Feng > >> ; Ard Biesheuvel > >> =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH] BaseTools: Add -ffat-lto= -objects option in > >> GCC5 tool chain > >> > >> Hi Liming, > >> > >> On 05/19/21 04:27, gaoliming wrote: > >>> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3403 > >>> > >>> This option can trig the uninitialized warning when lto is enabled. > >>> The image size data is also collected for OVMF. There is no impact. > >>> > >>> Cc: Sergei Dmitrouk > >>> Cc: Bob Feng > >>> Cc: Ard Biesheuvel > >>> Signed-off-by: Liming Gao > >>> --- > >>> BaseTools/Conf/tools_def.template | 16 ++++++++-------- > >>> 1 file changed, 8 insertions(+), 8 deletions(-) > >> > >> I've now read the documentation on "-ffat-lto-objects", and I agree t= hat > >> it should not affect the final module executable sizes. > >> > >> However, I don't understand how this option *helps*. You mention > >> "uninitialized warning". I find nothing related to that in the > >> documentation. > >> > >> According to the documentation, "fat" LTO objects include both object > >> code and intermediate language (GIMPLE) bytecode. Such objects can th= en > >> be linked with, or without, link-time (=3D interprocedural) optimizat= ion. > >> As I understand the documentation, "fat" LTO objects only make a > >> difference if there are parts of the toolchain that are themselves > >> unaware of LTO, and so need the GIMPLE bytecode to be present in the > >> object files. > >> > >> I *guess* that this is the situation that we have in edk2 -- is there > >> perhaps something in our toolchain(s) that does not "notice" LTO with= out > >> "fat" LTO objects, and therefore we fail to emit a warning? Because, > >> without LTO, we don't notice that an initialization is missing? > >> > >> This is too speculative. The commit message should please include mor= e > >> details. I'd like to understand what code in edk2 is affected, what t= he > >> specific warning is, what the problematic component in the toolchain = is > >> (i.e., what tool requires GIMPLE bytecode to be present in the object= file). > >> > >> Thanks, > >> Laszlo > >> > >> > >> > >>> > >>> diff --git a/BaseTools/Conf/tools_def.template > >> b/BaseTools/Conf/tools_def.template > >>> index 498696e583..aad5297385 100755 > >>> --- a/BaseTools/Conf/tools_def.template > >>> +++ b/BaseTools/Conf/tools_def.template > >>> @@ -2315,10 +2315,10 @@ > RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS > >> =3D -z common-page-size=3D0x20 > >>> *_GCC5_IA32_OBJCOPY_FLAGS =3D > >>> *_GCC5_IA32_NASM_FLAGS =3D -f elf32 > >>> > >>> - DEBUG_GCC5_IA32_CC_FLAGS =3D DEF(GCC5_IA32_CC_FLAGS) > >> -flto -Os > >>> + DEBUG_GCC5_IA32_CC_FLAGS =3D > DEF(GCC5_IA32_CC_FLAGS) > >> -ffat-lto-objects -flto -Os > >>> DEBUG_GCC5_IA32_DLINK_FLAGS =3D > >> DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os > >> -Wl,-m,elf_i386,--oformat=3Delf32-i386 > >>> > >>> -RELEASE_GCC5_IA32_CC_FLAGS =3D DEF(GCC5_IA32_CC_FLAGS) > >> -flto -Os -Wno-unused-but-set-variable -Wno-unused-const-variable > >>> +RELEASE_GCC5_IA32_CC_FLAGS =3D DEF(GCC5_IA32_CC_FLAGS) > >> -ffat-lto-objects -flto -Os -Wno-unused-but-set-variable > >> -Wno-unused-const-variable > >>> RELEASE_GCC5_IA32_DLINK_FLAGS =3D > >> DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os > >> -Wl,-m,elf_i386,--oformat=3Delf32-i386 > >>> > >>> NOOPT_GCC5_IA32_CC_FLAGS =3D > DEF(GCC5_IA32_CC_FLAGS) > >> -O0 > >>> @@ -2347,10 +2347,10 @@ RELEASE_GCC5_IA32_DLINK_FLAGS =3D > >> DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl, > >>> *_GCC5_X64_OBJCOPY_FLAGS =3D > >>> *_GCC5_X64_NASM_FLAGS =3D -f elf64 > >>> > >>> - DEBUG_GCC5_X64_CC_FLAGS =3D DEF(GCC5_X64_CC_FLAGS) > >> -flto -DUSING_LTO -Os > >>> + DEBUG_GCC5_X64_CC_FLAGS =3D DEF(GCC5_X64_CC_FLAGS) > >> -ffat-lto-objects -flto -DUSING_LTO -Os > >>> DEBUG_GCC5_X64_DLINK_FLAGS =3D > >> DEF(GCC5_X64_DLINK_FLAGS) -flto -Os > >>> > >>> -RELEASE_GCC5_X64_CC_FLAGS =3D DEF(GCC5_X64_CC_FLAGS) > >> -flto -DUSING_LTO -Os -Wno-unused-but-set-variable > >> -Wno-unused-const-variable > >>> +RELEASE_GCC5_X64_CC_FLAGS =3D DEF(GCC5_X64_CC_FLAGS) > >> -ffat-lto-objects -flto -DUSING_LTO -Os -Wno-unused-but-set-variable > >> -Wno-unused-const-variable > >>> RELEASE_GCC5_X64_DLINK_FLAGS =3D > DEF(GCC5_X64_DLINK_FLAGS) > >> -flto -Os > >>> > >>> NOOPT_GCC5_X64_CC_FLAGS =3D > DEF(GCC5_X64_CC_FLAGS) > >> -O0 > >>> @@ -2382,10 +2382,10 @@ RELEASE_GCC5_X64_DLINK_FLAGS =3D > >> DEF(GCC5_X64_DLINK_FLAGS) -flto -Os > >>> *_GCC5_ARM_VFRPP_FLAGS =3D $(ARCHCC_FLAGS) > >> $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) > >>> *_GCC5_ARM_CC_XIPFLAGS =3D > >> DEF(GCC5_ARM_CC_XIPFLAGS) > >>> > >>> - DEBUG_GCC5_ARM_CC_FLAGS =3D > DEF(GCC5_ARM_CC_FLAGS) > >> -flto -Wno-unused-but-set-variable -Wno-unused-const-variable > >>> + DEBUG_GCC5_ARM_CC_FLAGS =3D > DEF(GCC5_ARM_CC_FLAGS) > >> -ffat-lto-objects -flto -Wno-unused-but-set-variable > >> -Wno-unused-const-variable > >>> DEBUG_GCC5_ARM_DLINK_FLAGS =3D > >> DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os > >> -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm > >> -Wl,-plugin-opt=3D-pass-through=3D-llto-arm > >>> > >>> -RELEASE_GCC5_ARM_CC_FLAGS =3D > DEF(GCC5_ARM_CC_FLAGS) > >> -flto -Wno-unused-but-set-variable -Wno-unused-const-variable > >>> +RELEASE_GCC5_ARM_CC_FLAGS =3D > DEF(GCC5_ARM_CC_FLAGS) > >> -ffat-lto-objects -flto -Wno-unused-but-set-variable > >> -Wno-unused-const-variable > >>> RELEASE_GCC5_ARM_DLINK_FLAGS =3D > >> DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os > >> -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm > >> -Wl,-plugin-opt=3D-pass-through=3D-llto-arm > >>> > >>> NOOPT_GCC5_ARM_CC_FLAGS =3D > DEF(GCC5_ARM_CC_FLAGS) > >> -O0 > >>> @@ -2416,11 +2416,11 @@ RELEASE_GCC5_ARM_DLINK_FLAGS =3D > >> DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKS > >>> *_GCC5_AARCH64_VFRPP_FLAGS =3D $(ARCHCC_FLAGS) > >> $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) > >>> *_GCC5_AARCH64_CC_XIPFLAGS =3D > >> DEF(GCC5_AARCH64_CC_XIPFLAGS) > >>> > >>> - DEBUG_GCC5_AARCH64_CC_FLAGS =3D > >> DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable > >> -Wno-unused-const-variable > >>> + DEBUG_GCC5_AARCH64_CC_FLAGS =3D > >> DEF(GCC5_AARCH64_CC_FLAGS) -ffat-lto-objects -flto > >> -Wno-unused-but-set-variable -Wno-unused-const-variable > >>> DEBUG_GCC5_AARCH64_DLINK_FLAGS =3D > >> DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os > >> -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 > >> -Wl,-plugin-opt=3D-pass-through=3D-llto-aarch64 -Wno-lto-type-mismatc= h > >>> DEBUG_GCC5_AARCH64_DLINK_XIPFLAGS =3D -z > >> common-page-size=3D0x20 > >>> > >>> -RELEASE_GCC5_AARCH64_CC_FLAGS =3D > >> DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable > >> -Wno-unused-const-variable > >>> +RELEASE_GCC5_AARCH64_CC_FLAGS =3D > >> DEF(GCC5_AARCH64_CC_FLAGS) -ffat-lto-objects -flto > >> -Wno-unused-but-set-variable -Wno-unused-const-variable > >>> RELEASE_GCC5_AARCH64_DLINK_FLAGS =3D > >> DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os > >> -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 > >> -Wl,-plugin-opt=3D-pass-through=3D-llto-aarch64 -Wno-lto-type-mismatc= h > >>> RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS =3D -z > >> common-page-size=3D0x20 > >>> > >>> > > > > > > >=20 >=20 >=20 >=20 >=20