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 01C8321962301 for ; Thu, 6 Dec 2018 01:53:01 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Dec 2018 01:53:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,321,1539673200"; d="scan'208";a="116490176" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 06 Dec 2018 01:53:01 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 6 Dec 2018 01:53:01 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 6 Dec 2018 01:53:00 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.203]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.176]) with mapi id 14.03.0415.000; Thu, 6 Dec 2018 17:52:59 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Correct CCFLAG for PcdValueInit Thread-Index: AQHUhvj0Ejr1sdS72kKDa7uCWeVm/6VxhN2g Date: Thu, 6 Dec 2018 09:52:58 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E384D35@SHSMSX104.ccr.corp.intel.com> References: <20181128090118.74272-1-bob.c.feng@intel.com> In-Reply-To: <20181128090118.74272-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzQ2ODFiNTItMzg4Yi00MWVkLWI3YTQtNDliMjQ1MjY1MDE2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoieGJPWGw3a0RkVDBHVERCckRQVEM3Z0FoMTRKaVd0YjdLcVllMk1SbTMxRk9Ccmd1NXFjbWNCWTV2RkhHTlNjSiJ9 dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Correct CCFLAG for PcdValueInit X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2018 09:53:02 -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: Wednesday, November 28, 2018 5:01 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [Patch] BaseTools: Correct CCFLAG for PcdValueInit >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1361 > This patch is going to correct the CCFlag > for building PcdValueInit >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: BobCF > Cc: Liming Gao > --- > .../Source/Python/Workspace/DscBuildData.py | 24 +++++++++---------- > 1 file changed, 12 insertions(+), 12 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTool= s/Source/Python/Workspace/DscBuildData.py > index 11aa63fb26..c04f970c7d 100644 > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > @@ -2184,20 +2184,20 @@ class DscBuildData(PlatformBuildClassObject): > return False > return True >=20 > def ParseCCFlags(self, ccflag): > ccflags =3D set() > - flag =3D "" > - for ch in ccflag: > - if ch in (r"/", "-"): > - if flag.strip(): > - ccflags.add(flag.strip()) > - flag =3D ch > - else: > - flag +=3D ch > - if flag.strip(): > - ccflags.add(flag.strip()) > + ccflaglist =3D ccflag.split(" ") > + i =3D 0 > + while i < len(ccflaglist): > + item =3D ccflaglist[i].strip() > + if item in (r"/D", r"/U","-D","-U"): > + ccflags.add(" ".join((ccflaglist[i],ccflaglist[i+1]))) > + i =3D i+1 > + elif item.startswith((r"/D", r"/U","-D","-U")): > + ccflags.add(item) > + i +=3D1 > return ccflags > def GenerateByteArrayValue (self, StructuredPcds): > # > # Generate/Compile/Run C application to determine if there are a= ny flexible array members > # > @@ -2318,11 +2318,11 @@ class DscBuildData(PlatformBuildClassObject): > if Target =3D=3D "*" or Target =3D=3D self._Target: > if Tag =3D=3D "*" or Tag =3D=3D self._Toolchain: > if 'COMMON' not in BuildOptions: > BuildOptions['COMMON'] =3D set() > if Arch =3D=3D "*": > - BuildOptions['COMMON'].add(self.BuildOptions[Opt= ions]) > + BuildOptions['COMMON']|=3D self.ParseCCFlags(sel= f.BuildOptions[Options]) > if Arch in self.SupArchList: > if Arch not in BuildOptions: > BuildOptions[Arch] =3D set() > BuildOptions[Arch] |=3D self.ParseCCFlags(self.B= uildOptions[Options]) >=20 > @@ -2332,11 +2332,11 @@ class DscBuildData(PlatformBuildClassObject): > BuildOptions['COMMON'] |=3D (ArchBuildOptions.values()[0= ]) > elif len(ArchBuildOptions.keys()) > 1: > CommonBuildOptions =3D reduce(lambda x,y: x&y, ArchBuild= Options.values()) > BuildOptions['COMMON'] |=3D CommonBuildOptions > ValueList =3D list(BuildOptions['COMMON']) > - CC_FLAGS +=3D " ".join([item for item in ValueList if item.s= tartswith(('-D', '/D', '-U', '/U'))]) > + CC_FLAGS +=3D " ".join(ValueList) > MakeApp +=3D CC_FLAGS >=20 > if sys.platform =3D=3D "win32": > MakeApp =3D MakeApp + PcdMakefileEnd > MakeApp =3D MakeApp + AppTarget % ("""\tcopy $(APPLICATION) = $(APPFILE) /y """) > -- > 2.19.1.windows.1