From nobody Fri May 3 14:26:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1531138537876142.02334512504183; Mon, 9 Jul 2018 05:15:37 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5F25D209688E4; Mon, 9 Jul 2018 05:15:37 -0700 (PDT) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D85E3202E547B for ; Mon, 9 Jul 2018 05:15:35 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2018 05:15:35 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by orsmga003.jf.intel.com with ESMTP; 09 Jul 2018 05:15:33 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,330,1526367600"; d="scan'208";a="65469056" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Mon, 9 Jul 2018 20:15:30 +0800 Message-Id: <1531138530-14768-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] BaseTools: Fix the bug that incorrect size info in the Lib autogen X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The case is a PCD used in one library only, and in DSC component section the PCD value is override in one of module inf. Then it cause the bug the PCD size in the Lib autogen use the PCD value in the DSC PCD section, but not use the override value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/AutoGen/AutoGen.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 6d76afd..3908697 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1291,16 +1291,21 @@ class PlatformAutoGen(AutoGen): for LibAuto in self.LibraryAutoGenList: FixedAtBuildPcds =3D {} =20 ShareFixedAtBuildPcdsSameValue =3D {}=20 for Module in LibAuto._ReferenceModules: =20 for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildP= cds: + DefaultValue =3D Pcd.DefaultValue + # Cover the case: DSC component override the Pcd value= and the Pcd only used in one Lib + if Pcd in Module.LibraryPcdList: + Index =3D Module.LibraryPcdList.index(Pcd) + DefaultValue =3D Module.LibraryPcdList[Index].Defa= ultValue key =3D ".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCN= ame)) if key not in FixedAtBuildPcds: ShareFixedAtBuildPcdsSameValue[key] =3D True - FixedAtBuildPcds[key] =3D Pcd.DefaultValue + FixedAtBuildPcds[key] =3D DefaultValue else: - if FixedAtBuildPcds[key] !=3D Pcd.DefaultValue: + if FixedAtBuildPcds[key] !=3D DefaultValue: ShareFixedAtBuildPcdsSameValue[key] =3D False = =20 for Pcd in LibAuto.FixedAtBuildPcds: key =3D ".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName)) if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in self.N= onDynamicPcdDict: continue --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel