From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web11.8253.1661325400204149494 for ; Wed, 24 Aug 2022 00:16:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=SaXP4dJr; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: gaoliming@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id C8704CD1F6D9 for ; Wed, 24 Aug 2022 15:16:36 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1661325396; bh=5DYLLSqDhIyLlxUc9R8PUhrifME0DXpgCdCktGBeZmM=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=SaXP4dJrOsr9qzI1tmu/VxwjAJYJN4ryNxDO5nQiWA9LBfao3tOIkzn4oKQzr2pZQ LIzL3MBf0Xw8TVnCrkdWu4oChFrX7V8ZSSIH+4sZWYmerET1lu2sbcQiyE5LkG+GEz 9rWmJD5QOMmnoka1/AdxPn0ivFjp9Q01FIQPXnwI= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id C4333CD1F6C3 for ; Wed, 24 Aug 2022 15:16:36 +0800 (CST) X-Virus-Scanned: by SpamTitan at intel-email.com Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 85B25CD1F6B2 for ; Wed, 24 Aug 2022 15:16:36 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id 13219CD1F6D9 for ; Wed, 24 Aug 2022 15:16:32 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 24 Aug 2022 15:16:20 +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: "'Feng, Bob C'" , , "'Ard Biesheuvel'" , , "'Chen, Christine'" Cc: "'Andrew Fish'" , "'Leif Lindholm'" , "'Kinney, Michael D'" , "'Wang, Jian J'" References: <41a26d57-4fae-f53f-29ae-d6c7b258eaee@bsdio.com> <000a01d8b693$58d87c60$0a897520$@byosoft.com.cn> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gTWRlTW9kdWxlUGtnIGJ1aWxkIGZhaWxzIGZvciBBQVJDSDY0IG9uIFVidW50dSAyMi4wNA==?= Date: Wed, 24 Aug 2022 15:16:22 +0800 Message-ID: <010801d8b789$6a19ade0$3e4d09a0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQLbakymnymHua7oxeEsIFbF2fUIsQI6/JAYAvzEJsMCTw376QJJJWKkAuRhu2qrUpmjAA== Sender: "gaoliming" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Bob: The commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 was merged into Edk2 o= n Last month (2022 July 17th). This is very new change. It brings the behav= ior change. But, it doesn't highlight its impact to collect feedback. I suggest to revert it, because I think we need more time to discuss this = behavior change. Even if we decide to make this change, we also need to giv= e other people enough time to update DSC file.=20 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Feng, Bob C > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B48=E6=9C=8823=E6=97=A5 = 15:40 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; Gao, Liming ; > 'Ard Biesheuvel' ; rebecca@bsdio.com; Chen, Christine > > =E6=8A=84=E9=80=81: 'Andrew Fish' ; 'Leif Lindholm' > ; Kinney, Michael D > ; Wang, Jian J > =E4=B8=BB=E9=A2=98: RE: [edk2-devel] MdeModulePkg build fails for AARCH64= on Ubuntu > 22.04 >=20 > Hi Liming, >=20 > Reverting patch may not a good idea, some platforms have done the > implementation based on the DSC spec, if revert, those platforms build wi= ll > break. > This commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 make the > Basetools behavior be consistent with DSC spec so I don't think it's a > regression bug. >=20 > Thanks, > Bob >=20 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of gaoliming > via groups.io > Sent: Tuesday, August 23, 2022 9:55 AM > To: 'Ard Biesheuvel' ; devel@edk2.groups.io; > rebecca@bsdio.com; Feng, Bob C ; Chen, Christine > > Cc: 'Andrew Fish' ; 'Leif Lindholm' > ; Kinney, Michael D > ; Wang, Jian J > Subject: =E5=9B=9E=E5=A4=8D: [edk2-devel] MdeModulePkg build fails for AA= RCH64 on > Ubuntu 22.04 > Importance: High >=20 > Yuwei: > The commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 (BaseTools: > Fix DSC LibraryClass precedence rule) introduces this issue. I agree with= Ard > suggestion to revert this change first for this stable tag 202208. Then, = we can > discuss this change in the detail. >=20 > Thanks > Liming > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > =E5=8F=91=E4=BB=B6=E4=BA=BA: Ard Biesheuvel > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B48=E6=9C=8822=E6=97= =A5 17:34 > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; rebecca@bsdio.com; F= eng, Bob C > > ; Liming Gao > > =E6=8A=84=E9=80=81: Andrew Fish ; Leif Lindholm > > ; Michael D Kinney > > ; Jian J Wang > > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] MdeModulePkg build fails for AARCH= 64 on Ubuntu > > 22.04 > > > > On Mon, 22 Aug 2022 at 11:30, Ard Biesheuvel wrote: > > > > > > On Mon, 22 Aug 2022 at 11:11, Ard Biesheuvel wrote: > > > > > > > > (cc Bob) > > > > > > > > NOTE this affects the stable tag - please see below > > > > > > > > > > > > On Sun, 21 Aug 2022 at 06:34, Rebecca Cran > > wrote: > > > > > > > > > > I noticed that MdeModulePkg fails to build on my Ubuntu 22.04 > > > > > system (and previously on the Ubuntu 20.04 installation). Is this= a > known bug? > > > > > > > > > > It shouldn't be relevant, but I'm using gcc version 11.2.0 > > > > > (Ubuntu 11.2.0-17ubuntu1). But perhaps more relevant, I'm using > Python 3.10.4. > > > > > > > > > > I'm trying to build commit > > e2ac68a23b4954d5c0399913a1df3dd9fd90315d. > > > > > > > > > > > > > > > bcran@photon:~/src/tmp/edk2$ build -p > > MdeModulePkg/MdeModulePkg.dsc -a > > > > > AARCH64 -t GCC5 -b RELEASE > > > > > Build environment: Linux-5.15.0-46-generic-x86_64-with-glibc2.35 > > > > > Build start time: 22:29:18, Aug.20 2022 > > > > > > > > > > WORKSPACE =3D /home/bcran/src/tmp/edk2 > > > > > EDK_TOOLS_PATH =3D /home/bcran/src/tmp/edk2/BaseTools > > > > > CONF_PATH =3D /home/bcran/src/tmp/edk2/Conf > > > > > PYTHON_COMMAND =3D /usr/bin/python3 > > > > > > > > > > > > > > > Processing meta-data > > > > > .Architecture(s) =3D AARCH64 > > > > > Build target =3D RELEASE > > > > > Toolchain =3D GCC5 > > > > > > > > > > Active Platform =3D > > > > > /home/bcran/src/tmp/edk2/MdeModulePkg/MdeModulePkg.dsc > > > > > > > > > > > > > > > build.py... > > > > > > > > /home/bcran/src/tmp/edk2/MdeModulePkg/Library/SmmLockBoxLib/SmmL > > ockBoxPeiLib.inf(42): > > > > > error 3000: PCD > > > > > [gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode] in > > > > > > > > [/home/bcran/src/tmp/edk2/MdeModulePkg/Library/SmmLockBoxLib/SmmL > > ockBoxPeiLib.inf] > > > > > is not found in dependent packages: > > > > > > /home/bcran/src/tmp/edk2/MdePkg/MdePkg.dec > > > > > > > /home/bcran/src/tmp/edk2/MdeModulePkg/MdeModulePkg.dec > > > > > > > > > > > > > > > > > > This looks like a BaseTools regression to me - afaik, these > > > > packages all used to build for AARCH64 in the past. > > > > > > > > The following LockBoxLib resolutions appear in MdeModulePkg.dsc > > > > (with line numbers) > > > > > > > > 115-[LibraryClasses.common.PEIM] > > > > 119: > > > LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf > > > > > > > > 178-[LibraryClasses.ARM, LibraryClasses.AARCH64] > > > > 181: > > LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf > > > > > > > > No other [LlibraryClasses] references to SmmLockBoxPeiLib.inf > > > > exist in that file, and the [Components] reference does not apply t= o > AARCH64. > > > > > > > > This means the DSC parser ends up using the earlier definition, > > > > which I think is a bug, or at least a change in behavior. Note > > > > that doing this silently could potentially break many platforms in > > > > subtle ways so I think this should be root caused and preferably > > > > fixed before creating the stable tag. > > > > > > Seems to be deliberate: > > > > > > commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 > > > Author: Chen, Christine > > > Date: Thu Jun 30 17:04:05 2022 +0800 > > > > > > BaseTools: Fix DSC LibraryClass precedence rule > > > > > > but I don't think the impact on other platforms and drivers has been > > > taken into account here. Also, the document [0] seems ambiguous to me= : > > > > > > """ > > > The first globally defined library instance, defined in a DSC file, > > > that satisfies a module's requirement for a Library Class, unless > > > specifically overridden by the module in the [Components] section, > > > will be used. > > > """ > > > > > > This says that the first occurrence of a library instance definition > > > that satisfies a INF dependency will be selected. Then, there is > > > > > > """ > > > The Library Instances will be selected using the following rules to > > > satisfy a library class for each module listed in the [Components] > > > section (in order of highest precedence): > > > """ > > > > > > which says that not the *first* occurrence, but the occurrence *with > > > the highest precedence* will be selected. > > > > > > Then, the precedence list has these items: > > > > > > """ > > > 2. [LibraryClasses.$(Arch).$(MODULE_TYPE), > > > LibraryClasses.$(Arch).$(MODULE_TYPE)] > > > 3. [LibraryClasses.$(Arch).$(MODULE_TYPE)] > > > """ > > > > > > which seem to suggest that a definition that applies to multiple > > > arch/module_type combinations automatically takes precedence over > > > one that targets a single arch/module_type combination, which makes > > > no sense at all. > > > > > > So I strongly suggest we revert the patch, fix the document so it is > > > clear and ambiguous, and preferably, align it with how it used to > > > > *un*ambiguous .... > > > > sigh >=20 >=20 >=20 >=20 >=20 >=20