From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False 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 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,330,1526367600"; d="scan'208";a="65469056" 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 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: [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: , X-List-Received-Date: Mon, 09 Jul 2018 12:15:36 -0000 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 --- 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 = {} ShareFixedAtBuildPcdsSameValue = {} for Module in LibAuto._ReferenceModules: for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds: + DefaultValue = 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 = Module.LibraryPcdList.index(Pcd) + DefaultValue = Module.LibraryPcdList[Index].DefaultValue key = ".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName)) if key not in FixedAtBuildPcds: ShareFixedAtBuildPcdsSameValue[key] = True - FixedAtBuildPcds[key] = Pcd.DefaultValue + FixedAtBuildPcds[key] = DefaultValue else: - if FixedAtBuildPcds[key] != Pcd.DefaultValue: + if FixedAtBuildPcds[key] != DefaultValue: ShareFixedAtBuildPcdsSameValue[key] = False for Pcd in LibAuto.FixedAtBuildPcds: key = ".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName)) if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in self.NonDynamicPcdDict: continue -- 2.6.1.windows.1