From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 08B3DD80550 for ; Thu, 17 Aug 2023 11:45:16 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=6RGbYWCK3dDfnl/Mejkj6J4UgRJbSo0aw7ujG2PMJXY=; c=relaxed/simple; d=groups.io; h=From:MIME-version:Subject:Date:Message-id:References:Cc:In-reply-to:To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-type:Content-transfer-encoding; s=20140610; t=1692272715; v=1; b=KUZqUM4kIFgYqzd8z+BnBOqzCZ7nCgxy599p0fSpj7TzjFuKyqEIh2IaaspCr96x51GgfQnH GFSd3DUVgDFzrq7huM8tsmr3GzKKfdNDZy70BECH0jNJbS2Q+rLEkuDdsaJuxTGdG+pmBA6Owq6 4lpzw/sxzKrUdMJ2y2j9d4gw= X-Received: by 127.0.0.2 with SMTP id r5q5YY7687511xY6powjqjC3; Thu, 17 Aug 2023 04:45:15 -0700 X-Received: from ma-mailsvcp-mx-lapp02.apple.com (ma-mailsvcp-mx-lapp02.apple.com [17.32.222.23]) by mx.groups.io with SMTP id smtpd.web10.185261.1692272714602819785 for ; Thu, 17 Aug 2023 04:45:14 -0700 X-Received: from ma-mailsvcp-mta-lapp03.corp.apple.com (ma-mailsvcp-mta-lapp03.corp.apple.com [10.226.18.135]) by ma-mailsvcp-mx-lapp02.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0RZJ004LN9ZDZI40@ma-mailsvcp-mx-lapp02.apple.com> for devel@edk2.groups.io; Thu, 17 Aug 2023 04:45:13 -0700 (PDT) X-Proofpoint-ORIG-GUID: WWT0cgslxC06i96kJSauDbH2Py5qM5-1 X-Proofpoint-GUID: WWT0cgslxC06i96kJSauDbH2Py5qM5-1 X-Received: from ma-mailsvcp-mmp-lapp04.apple.com (ma-mailsvcp-mmp-lapp04.apple.com [17.32.222.17]) by ma-mailsvcp-mta-lapp03.corp.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0RZJ00OBH9ZDU940@ma-mailsvcp-mta-lapp03.corp.apple.com>; Thu, 17 Aug 2023 04:45:13 -0700 (PDT) X-Received: from process_milters-daemon.ma-mailsvcp-mmp-lapp04.apple.com by ma-mailsvcp-mmp-lapp04.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) id <0RZJ00I009WEW600@ma-mailsvcp-mmp-lapp04.apple.com>; Thu, 17 Aug 2023 04:45:13 -0700 (PDT) X-Va-A: X-Va-T-CD: 9fcd0222c93167b2b4723e6d3bec4aae X-Va-E-CD: 81f81af75f72de43e63df40d8c881d19 X-Va-R-CD: 24cf420fcec2b9c8475fa14e52ebe880 X-Va-ID: 00a27f3a-dd67-47d6-86ed-d4eb0b9f7edb X-Va-CD: 0 X-V-A: X-V-T-CD: 9fcd0222c93167b2b4723e6d3bec4aae X-V-E-CD: 81f81af75f72de43e63df40d8c881d19 X-V-R-CD: 24cf420fcec2b9c8475fa14e52ebe880 X-V-ID: 38faa383-cee9-48c2-b4e9-112baa7c45f9 X-V-CD: 0 X-Received: from smtpclient.apple (unknown [17.10.0.98]) by ma-mailsvcp-mmp-lapp04.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPSA id <0RZJ00K1B9ZC9O00@ma-mailsvcp-mmp-lapp04.apple.com>; Thu, 17 Aug 2023 04:45:13 -0700 (PDT) From: "Andrew Fish via groups.io" MIME-version: 1.0 (1.0) Subject: =?UTF-8?B?UmU6IFtlZGsyLWRldmVsXSBDYW4gUkVMRUFTRSB0YXJnZXQgZGlzYWJsZSAtV2Vycm9yIENDX0ZMQUfvvJ8=?= Date: Thu, 17 Aug 2023 04:45:01 -0700 Message-id: <8CFC95B8-3B45-4CAC-A159-F6F31088414E@apple.com> References: <7fd9a0bb.6fde.18a02303b9d.Coremail.wangliu@iscas.ac.cn> Cc: "Kinney, Michael D" In-reply-to: <7fd9a0bb.6fde.18a02303b9d.Coremail.wangliu@iscas.ac.cn> To: devel@edk2.groups.io, wangliu@iscas.ac.cn Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,afish@apple.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: OnRby2zEiYwnuFRVVVgLP533x7686176AA= Content-type: multipart/alternative; boundary=Apple-Mail-88E59284-EAE8-4220-9FDB-0A845370C516 Content-transfer-encoding: 7bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=KUZqUM4k; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none --Apple-Mail-88E59284-EAE8-4220-9FDB-0A845370C516 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Can you add -Wno-maybe-uninitialized to= compiler flags to work around the error?


On Aug 16, 2023, at 11:31 PM, = =E6=B1=AA=E6=B5=81 <wangliu@iscas.ac.cn> wrote:

<= /div>
=EF=BB=BF

This is the failed build log: https://build.tarsier-infra.com/p= ackage/live_build_log/home:ouuleilei:branches:openEuler:Mainline/edk2/openE= uler_Mainline_standard_riscv64_gcc/riscv64

    arch:   =      riscv64

    gcc version= =EF=BC=9A 10.3.1





-----=E5=8E=9F=E5=A7=8B=E9=83=B5=E4=BB=B6-----
=E7=99=BC=E4=BB=B6=E4=BA=BA:"Kinney, Michael D"= <michael.d.kinney@intel.com>
=E7=99=BC=E9=80=81=E6=99=82=E9=96=93:2023-0= 8-17 01:50:37 (=E6=98=9F=E6=9C=9F=E5=9B=9B)
=E6=94=B6=E4=BB=B6=E4=BA=BA: "Andrew (EFI) Fish" <afish@apple.com= >, edk2-devel-groups-io <devel@edk2.groups.io>
=E6=8A=84=E9=80=81: "wangliu@iscas.ac.cn" <wangliu@iscas.ac.cn>= ;, "Kinney, Michael D" <michael.d.kinney@intel.com>
=E4=B8=BB=E9=A1=8C: RE: [edk2-devel] Can RELEASE target disable -Wer= ror CC_FLAG=EF=BC=9F

Hi Andrew,

 

There are compiler flags we set to suppress some of these types of spe= cific warnings to avoid disable warnings as errors.

 

For example, this commit to tools_def.template:

 

https://github.com/tianocore/edk2/commit/8e985ac3fd= b2b117968ac1fa1f54666e166af8ac

 

I would like to see the compiler, version, arch, log info with the spe= cific warning being flagged to see if we can apply the techniques we have b= een able to apply in the past.

 

Mike

 

From: Andrew (EFI) Fish <afish@apple.com>
Sent: Wednesday, August 16, 2023 10:41 AM
To: edk2-devel-groups-io <devel@edk2.groups.io>; Kinney, Micha= el D <michael.d.kinney@intel.com>
Cc: wangliu@iscas.ac.cn
Subject: Re: [edk2-devel] Can RELEASE target disable -Werror CC_FLAG= =EF=BC=9F

 

Mike,

 

I seem to remember it was a maybe-uninitialized&n= bsp;compiler error. The DEBUG build did not hit it due to the NULL check in= the ASSERT. The NULL check only exists if ASSERT() is enabled. So if ASSERT is disabled this code in = the DXE Core will dereference a NULL pointer. 

 

      ASSER= T (Prot !=3D NULL);

      //&nb= sp;

      // EF= I_ALREADY_STARTED is not an error for bus driver.

      // Re= turn the corresponding protocol interface.

      //&nb= sp;

      *Inte= rface =3D Prot->Interface;

 

Thanks,

 

Andrew Fish



On Aug 16, 2023, at 10:02 AM, Michael D Kinney <michael.d.kinney@intel.com> wrote:

 

Can you provide the specific build error?

 

So far, we have not had to relax that flag for any RELEASE build= s.

 

Thanks,

 

Mike

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of ??
Sent: Wednesday, A= ugust 16, 2023 12:46 AM
To: Andrew (EFI) F= ish <afish@apple.com>
Cc: edk2-devel-gro= ups-io <devel@edk2.groups.io= >
Subject: Re: [edk2= -devel] Can RELEASE target disable -Werror CC_FLAG=EF=BC=9F

 

Yes, the RE= LEASE build compiler flags should be relaxed, all error checks that the DEB= UG target should do, it doesn't belong to the RELEASE's job.= =20

 =20

--- 
OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 2 +- 
1 file changed, 1 insertion(+), 1 deletion(-) 

diff --git a/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc b/OvmfPkg/RiscVVirt/RiscVV= irtQemu.dsc 
index 28d9af4..ac3b5ec 100644 
--- a/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc 
+++ b/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc 
@@ -54,7 +54,7 @@ 
!include MdePkg/MdeLibs.dsc.inc =

[BuildOptions] 
-  GCC:RELEASE_*_*_CC_FLAGS       =3D -D= MDEPKG_NDEBUG 
+  GCC:RELEASE_*_*_CC_FLAGS       =3D -f= lto 
!ifdef $(SOURCE_DEBUG_ENABLE) 
  GCC:*_*_RISCV64_GENFW_FLAGS    =3D --keepexcepti= ontable 
!endif 
-- 
2.39.1


=20

I have adde= d the LTO flag and dropped MDEPKG_NDEBUG in the .dsc file, it compiled succ= essfully, the build log:https://build.tarsier-infra.com/packag= e/live_build_log/home:ouuleilei:branches:openEuler:Mainline/edk2/openEuler_= Mainline_standard_riscv64_gcc/riscv64=20

Do you have= other way to add LTO flag to compile that don't change the source code, i = tried to use environment variable, like exported CFLAGS=3D-flto to compile,= but the compiler doesn't work with it.=20

 

 =20

 =20

 =20

-----=E5=8E=9F=E5=A7=8B=E9= =83=B5=E4=BB=B6-----
=E7=99=BC=E4=BB=B6=E4=BA=BA:"Andrew (EFI) Fish" <afish@apple.com>
=E7=99=BC=E9=80=81=E6=99=82=E9=96=93:2023-08-10 21:50:55 (=E6=98=9F= =E6=9C=9F=E5=9B=9B)
=E6=94=B6=E4=BB=B6=E4=BA=BA:&n= bsp;edk2-devel-groups-io <devel@edk2.groups.io>, <= /span>wangliu@iscas.ac.cn
=E6=8A=84=E9=80=81: 
=E4=B8=BB=E9=A1=8C: Re: [edk2-devel] Can RELEASE target disable -Werror CC_FLAG=EF=BC=9F

I think that you are ad= vocating that since we have code that error checks on DEBUG and not RELEASE= builds we should relax the RELEASE build compiler flags?

 

/home/abuild/rpmbuild/BUILD/edk2-edk2-stable202305/MdeModulePkg/C=
ore/Dxe/Hand/Handle.c:1183:24: error: =E2=80=98Prot=E2=80=99 may be used un=
initialized [-Werror=3Dmaybe-uninitialized]

      AS= SERT (Prot !=3D NULL);

      //=  

      //= EFI_ALREADY_STARTED is not an error for bus driver.

      //= Return the corresponding protocol interface.

      //=  

      *I= nterface =3D Prot->Interface;

 

A given platform can ad= d ASSERT into release builds if it wants. I=E2=80=99ve actually done that f= or power on before. If your compiler supports LTO you are not required to s= et MDEPKG_NDEBUG on RELEASE builds, and you can used a PCD to configure your debug level, per build type.  

 

Maybe we should just ha= ve the error checks in all paths?

 

Thanks, 

 

Andrew Fish 




On Aug 10, 2023, at 6= :44 AM, =E6=B1=AA=E6=B5=81 <wangl= iu@iscas.ac.cn> wrote:

 

I want to build a rpm= package for edk2-stable202305 on riscv64, however I get some uninitialized= variable error, I have found that the reason is -Werror flag.
My build target was release. I think the flag should used in the debug ,not= in release.
My build command:  build -t GCC5 -n $NCPUS -b RELEASE -a RISCV64 -p Ov= mfPkg/RiscVVirt/RiscVVirtQemu.dsc -D SECURE_BOOT_ENABLE=3DTRUE -D TPM_ENABL= E=3DTRUE -D TPM_CONFIG_ENABLE=3DTRUE

This i= s my packet log:    =20

https://build.tarsier-infra.com/package= /live_build_log/home:ouuleilei:branches:home:ouuleilei:branches:openEuler:M= ainline/edk2-test/openEuler_Mainline_standard_riscv64_gcc/riscv64=20

 

=20

 

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#107829) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--Apple-Mail-88E59284-EAE8-4220-9FDB-0A845370C516--