From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 705D980297 for ; Tue, 21 Mar 2017 18:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490147112; x=1521683112; h=from:to:cc:subject:date:message-id; bh=qRg9ObOI9piDkJDT0smeCdSOAhCub6ZdHDABrEH/ZzI=; b=INAWHyM70UCGUFLcKoKwIQCgUErbcKkMiafWOwasMUJs84zx8WYF1dDM SEtgxY76ebXmU8Eu7WDrAp098CE/nA==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2017 18:45:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,202,1486454400"; d="scan'208";a="79640499" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by fmsmga006.fm.intel.com with ESMTP; 21 Mar 2017 18:45:11 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Liming Gao Date: Wed, 22 Mar 2017 09:45:10 +0800 Message-Id: <1490147110-29700-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: Fix build failure for DynamicEx Pcd used in the Library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Mar 2017 01:45:12 -0000 Update DynExPcdTokenNumberMapping logic, currently even it is Library, its self's Pcd is saved into ModulePcdList. Fixes:https://bugzilla.tianocore.org/show_bug.cgi?id=434 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu --- BaseTools/Source/Python/AutoGen/GenC.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py index c1d64cc..96b1459 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -672,14 +672,12 @@ gModuleTypeHeaderFile = { # # def DynExPcdTokenNumberMapping(Info, AutoGenH): ExTokenCNameList = [] PcdExList = [] - if Info.IsLibrary: - PcdList = Info.LibraryPcdList - else: - PcdList = Info.ModulePcdList + # Even it is the Library, the PCD is saved in the ModulePcdList + PcdList = Info.ModulePcdList for Pcd in PcdList: if Pcd.Type in gDynamicExPcd: ExTokenCNameList.append(Pcd.TokenCName) PcdExList.append(Pcd) if len(ExTokenCNameList) == 0: @@ -1153,11 +1151,11 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd): # If PcdGet/Set used in the Pcds with different Guids but same CName, it should failed to build. if PcdExCNameList.count(Pcd.TokenCName) > 1: AutoGenH.Append('// Disabled the macros, as PcdToken and PcdGet/Set are not allowed in the case that more than one DynamicEx Pcds are different Guids but same CName.\n') AutoGenH.Append('// #define %s %s\n' % (PcdTokenName, PcdExTokenName)) AutoGenH.Append('// #define %s LibPcdGetEx%s(&%s, %s)\n' % (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName)) - AutoGenH.Append('// #define %s LibPcdGetExSize(&%s, %s \n' % (GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName)) + AutoGenH.Append('// #define %s LibPcdGetExSize(&%s, %s)\n' % (GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName)) if Pcd.DatumType == 'VOID*': AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibPcdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName)) AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibPcdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName)) else: AutoGenH.Append('// #define %s(Value) LibPcdSetEx%s(&%s, %s, (Value))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName)) -- 2.6.1.windows.1