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.115; helo=mga14.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 26D4D20985981 for ; Sun, 20 May 2018 05:56:06 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 May 2018 05:56:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,423,1520924400"; d="scan'208";a="42417522" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by orsmga007.jf.intel.com with ESMTP; 20 May 2018 05:56:04 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Yunhua Feng , Liming Gao Date: Sun, 20 May 2018 20:56:02 +0800 Message-Id: <1526820962-31464-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: Library PCD type will inherit from the driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2018 12:56:06 -0000 From: Yunhua Feng If a PCD is not referenced in global PCD section of DSC file at all, but is referenced in module scope, then the default PCD type for libs should be the module scoped PCD type. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=901 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/AutoGen/AutoGen.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index f29df21..1715101 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -428,10 +428,26 @@ class WorkspaceAutoGen(AutoGen): if key in PlatformModule.Pcds: PcdInPlatform = PlatformModule.Pcds[key] if PcdInPlatform.Type: BuildData.Pcds[key].Type = PcdInPlatform.Type BuildData.Pcds[key].Pending = False + else: + #Pcd used in Library, Pcd Type from reference module if Pcd Type is Pending + if BuildData.Pcds[key].Pending: + MGen = ModuleAutoGen(self, BuildData.MetaFile, Target, Toolchain, Arch, self.MetaFile) + if MGen and MGen.IsLibrary: + if MGen in PGen.LibraryAutoGenList: + ReferenceModules = MGen._ReferenceModules + for ReferenceModule in ReferenceModules: + if ReferenceModule.MetaFile in Platform.Modules: + RefPlatformModule = Platform.Modules[str(ReferenceModule.MetaFile)] + if key in RefPlatformModule.Pcds: + PcdInReferenceModule = RefPlatformModule.Pcds[key] + if PcdInReferenceModule.Type: + BuildData.Pcds[key].Type = PcdInReferenceModule.Type + BuildData.Pcds[key].Pending = False + break if TAB_PCDS_DYNAMIC_EX in BuildData.Pcds[key].Type: if BuildData.IsBinaryModule: BinaryPcdDict[TAB_PCDS_DYNAMIC_EX].add((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) else: -- 2.6.1.windows.1