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=liming.gao@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 EC4DF21E256B6 for ; Thu, 25 Jan 2018 01:49:10 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jan 2018 01:54:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,411,1511856000"; d="scan'208";a="198529377" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 25 Jan 2018 01:54:39 -0800 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 Jan 2018 01:54:39 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 Jan 2018 01:54:39 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Thu, 25 Jan 2018 17:54:37 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Fixed build failure for the case that A pcd is initialized under one SKU but is uninitialized under another SKU. Thread-Index: AQHTk+r41V888DJDDk+UN0EEs2j+naOEXSoQ Date: Thu, 25 Jan 2018 09:54:36 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1AC6E9@SHSMSX104.ccr.corp.intel.com> References: <20180123013836.2188-1-bob.c.feng@intel.com> In-Reply-To: <20180123013836.2188-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Fixed build failure for the case that A pcd is initialized under one SKU but is uninitialized under another SKU. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jan 2018 09:49:11 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Feng, Bob C >Sent: Tuesday, January 23, 2018 9:39 AM >To: edk2-devel@lists.01.org >Cc: Feng, Bob C ; Gao, Liming >Subject: [Patch] BaseTools: Fixed build failure for the case that A pcd is >initialized under one SKU but is uninitialized under another SKU. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Bob Feng >Cc: Liming Gao >--- > BaseTools/Source/Python/AutoGen/GenPcdDb.py | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py >b/BaseTools/Source/Python/AutoGen/GenPcdDb.py >index 22283ef7fe..82360ae57d 100644 >--- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py >+++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py >@@ -1022,10 +1022,23 @@ def CreateAutoGen(PcdDriverAutoGenData): > return (PcdDriverAutoGenData[(skuname,skuid)][0],autogenC) > def NewCreatePcdDatabasePhaseSpecificAutoGen(Platform,Phase): > def prune_sku(pcd,skuname): > new_pcd =3D copy.deepcopy(pcd) > new_pcd.SkuInfoList =3D {skuname:pcd.SkuInfoList[skuname]} >+ new_pcd.isinit =3D 'INIT' >+ if new_pcd.DatumType in ['UINT8','UINT16','UINT32','UINT64']: >+ for skuobj in pcd.SkuInfoList.values(): >+ if skuobj.DefaultValue: >+ defaultvalue =3D int(skuobj.DefaultValue,16) if >skuobj.DefaultValue.upper().startswith("0X") else int(skuobj.DefaultValue,= 10) >+ if defaultvalue !=3D 0: >+ new_pcd.isinit =3D "INIT" >+ break >+ elif skuobj.VariableName: >+ new_pcd.isinit =3D "INIT" >+ break >+ else: >+ new_pcd.isinit =3D "UNINIT" > return new_pcd > DynamicPcds =3D Platform.DynamicPcdList > DynamicPcdSet_Sku =3D {(SkuName,skuobj.SkuId):[] for pcd in DynamicPc= ds >for (SkuName,skuobj) in pcd.SkuInfoList.items() } > for skuname,skuid in DynamicPcdSet_Sku: > DynamicPcdSet_Sku[(skuname,skuid)] =3D [prune_sku(pcd,skuname) fo= r >pcd in DynamicPcds] >@@ -1399,12 +1412,11 @@ def CreatePcdDatabasePhaseSpecificAutoGen >(Platform, DynamicPcdList, Phase): > if "PCD_TYPE_HII" not in Pcd.TokenTypeList: > Pcd.TokenTypeList +=3D ['PCD_TYPE_DATA'] > if Sku.DefaultValue =3D=3D 'TRUE': > Pcd.InitString =3D 'INIT' > else: >- if int(Sku.DefaultValue, 0) !=3D 0: >- Pcd.InitString =3D 'INIT' >+ Pcd.InitString =3D Pcd.isinit > # > # For UNIT64 type PCD's value, ULL should be append to av= oid > # warning under linux building environment. > # > if Pcd.DatumType =3D=3D "UINT64": >-- >2.14.3.windows.1