From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 33A2A211B5080 for ; Tue, 8 Jan 2019 23:01:23 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2019 23:01:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,456,1539673200"; d="scan'208";a="108443317" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga008.jf.intel.com with ESMTP; 08 Jan 2019 23:01:22 -0800 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 8 Jan 2019 23:01:22 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 8 Jan 2019 23:01:21 -0800 Received: from shsmsx152.ccr.corp.intel.com ([169.254.6.44]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.150]) with mapi id 14.03.0415.000; Wed, 9 Jan 2019 15:01:18 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" CC: "Carsey, Jaben" Thread-Topic: [Patch 1/3] BaseTools: Remove unused logic for EDKI Thread-Index: AQHUp+bQBMejGL6zGUezXmqtJu4sRqWmflmQ Date: Wed, 9 Jan 2019 07:01:18 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E3AE333@SHSMSX152.ccr.corp.intel.com> References: <20190109064423.59300-1-bob.c.feng@intel.com> In-Reply-To: <20190109064423.59300-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWZhMmY3YjItMzE5OS00MDg0LWFkMDEtNGM2MDEwYmE2OGFmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibG9yYmRrRlNBek5cL1lZRFRQT0doYXdXcm9sYmNodXRyOTc0anVOalZLRDFZZ3BrdEU0bTQ2Q1VEclwvbGY1MVRKIn0= 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 1/3] BaseTools: Remove unused logic for EDKI 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: Wed, 09 Jan 2019 07:01:24 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch removes the logic from BaseTools python code, not C code. And, p= lease also include BZ link in the commit message.=20 Thanks Liming > -----Original Message----- > From: Feng, Bob C > Sent: Wednesday, January 9, 2019 2:44 PM > To: edk2-devel@lists.01.org > Cc: Feng, Bob C ; Gao, Liming ; Carsey, Jaben > Subject: [Patch 1/3] BaseTools: Remove unused logic for EDKI >=20 > From: "Feng, Bob C" >=20 > Remove EDK module type support from BaseTools C code. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Bob Feng > Cc: Liming Gao > Cc: Jaben Carsey > --- > BaseTools/Source/Python/AutoGen/AutoGen.py | 93 ++------- > BaseTools/Source/Python/AutoGen/GenC.py | 90 ++++----- > BaseTools/Source/Python/AutoGen/GenMake.py | 18 +- > BaseTools/Source/Python/Common/DataType.py | 2 - > BaseTools/Source/Python/Common/GlobalData.py | 6 - > .../Source/Python/Workspace/DecBuildData.py | 1 - > .../Source/Python/Workspace/DscBuildData.py | 3 - > .../Source/Python/Workspace/InfBuildData.py | 191 +++++------------- > .../Source/Python/Workspace/MetaFileParser.py | 22 -- > .../Python/Workspace/WorkspaceCommon.py | 29 +-- > BaseTools/Source/Python/build/BuildReport.py | 54 ++--- > BaseTools/Source/Python/build/build.py | 65 ------ > edksetup.bat | 3 - > 13 files changed, 116 insertions(+), 461 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Sourc= e/Python/AutoGen/AutoGen.py > index d646cd50ce..d3d0d96e71 100644 > --- a/BaseTools/Source/Python/AutoGen/AutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py > @@ -2174,46 +2174,11 @@ class PlatformAutoGen(AutoGen): > Pcd.MaxDatumSize =3D str(len(Value.split(','))) > else: > Pcd.MaxDatumSize =3D str(len(Value) - 1) > return Pcds.values() >=20 > - ## Resolve library names to library modules > - # > - # (for Edk.x modules) > - # > - # @param Module The module from which the library names will be = resolved > - # > - # @retval library_list The list of library modules > - # > - def ResolveLibraryReference(self, Module): > - EdkLogger.verbose("") > - EdkLogger.verbose("Library instances of module [%s] [%s]:" % (st= r(Module), self.Arch)) > - LibraryConsumerList =3D [Module] > - > - # "CompilerStub" is a must for Edk modules > - if Module.Libraries: > - Module.Libraries.append("CompilerStub") > - LibraryList =3D [] > - while len(LibraryConsumerList) > 0: > - M =3D LibraryConsumerList.pop() > - for LibraryName in M.Libraries: > - Library =3D self.Platform.LibraryClasses[LibraryName, ':= dummy:'] > - if Library is None: > - for Key in self.Platform.LibraryClasses.data: > - if LibraryName.upper() =3D=3D Key.upper(): > - Library =3D self.Platform.LibraryClasses[Key= , ':dummy:'] > - break > - if Library is None: > - EdkLogger.warn("build", "Library [%s] is not fou= nd" % LibraryName, File=3Dstr(M), > - ExtraData=3D"\t%s [%s]" % (str(Module), self= .Arch)) > - continue >=20 > - if Library not in LibraryList: > - LibraryList.append(Library) > - LibraryConsumerList.append(Library) > - EdkLogger.verbose("\t" + LibraryName + " : " + str(L= ibrary) + ' ' + str(type(Library))) > - return LibraryList >=20 > ## Calculate the priority value of the build option > # > # @param Key Build option definition contain: TARGET_TOOLCHAIN= _ARCH_COMMANDTYPE_ATTRIBUTE > # > @@ -2377,16 +2342,12 @@ class PlatformAutoGen(AutoGen): > # > # @retval options The options appended with build options in p= latform > # > def ApplyBuildOption(self, Module): > # Get the different options for the different style module > - if Module.AutoGenVersion < 0x00010005: > - PlatformOptions =3D self.EdkBuildOption > - ModuleTypeOptions =3D self.Platform.GetBuildOptionsByModuleT= ype(EDK_NAME, Module.ModuleType) > - else: > - PlatformOptions =3D self.EdkIIBuildOption > - ModuleTypeOptions =3D self.Platform.GetBuildOptionsByModuleT= ype(EDKII_NAME, Module.ModuleType) > + PlatformOptions =3D self.EdkIIBuildOption > + ModuleTypeOptions =3D self.Platform.GetBuildOptionsByModuleType(= EDKII_NAME, Module.ModuleType) > ModuleTypeOptions =3D self._ExpandBuildOption(ModuleTypeOptions) > ModuleOptions =3D self._ExpandBuildOption(Module.BuildOptions) > if Module in self.Platform.Modules: > PlatformModule =3D self.Platform.Modules[str(Module)] > PlatformModuleOptions =3D self._ExpandBuildOption(PlatformMo= dule.BuildOptions) > @@ -2422,15 +2383,10 @@ class PlatformAutoGen(AutoGen): > if Attr !=3D 'PATH': > BuildOptions[Tool][Attr] +=3D " " + mws.hand= leWsMacro(Value) > else: > BuildOptions[Tool][Attr] =3D mws.handleWsMac= ro(Value) >=20 > - if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag= is not None: > - # > - # Override UNI flag only for EDK module. > - # > - BuildOptions['BUILD']['FLAGS'] =3D self.Workspace.UniFlag > return BuildOptions, BuildRuleOrder >=20 > # > # extend lists contained in a dictionary with lists stored in another di= ctionary > # if CopyToDict is not derived from DefaultDict(list) then this may rais= e exception > @@ -2962,18 +2918,17 @@ class ModuleAutoGen(AutoGen): >=20 > # > # EDK II modules must not reference header files outside of = the packages they depend on or > # within the module's directory tree. Report error if violat= ion. > # > - if self.AutoGenVersion >=3D 0x00010005: > - for Path in IncPathList: > - if (Path not in self.IncludePathList) and (CommonPat= h([Path, self.MetaFile.Dir]) !=3D self.MetaFile.Dir): > - ErrMsg =3D "The include directory for the EDK II= module in this line is invalid %s specified in %s FLAGS '%s'" % > (Path, Tool, FlagOption) > - EdkLogger.error("build", > - PARAMETER_INVALID, > - ExtraData=3DErrMsg, > - File=3Dstr(self.MetaFile)) > + for Path in IncPathList: > + if (Path not in self.IncludePathList) and (CommonPath([P= ath, self.MetaFile.Dir]) !=3D self.MetaFile.Dir): > + ErrMsg =3D "The include directory for the EDK II mod= ule in this line is invalid %s specified in %s FLAGS '%s'" % > (Path, Tool, FlagOption) > + EdkLogger.error("build", > + PARAMETER_INVALID, > + ExtraData=3DErrMsg, > + File=3Dstr(self.MetaFile)) > RetVal +=3D IncPathList > return RetVal >=20 > ## Return a list of files which can be built from source > # > @@ -2999,11 +2954,11 @@ class ModuleAutoGen(AutoGen): > "but current toolchain family is [%s], build= rule family is [%s]" \ > % (str(F), F.ToolChainFamily, self.ToolC= hainFamily, self.BuildRuleFamily)) > continue >=20 > # add the file path into search path list for file including > - if F.Dir not in self.IncludePathList and self.AutoGenVersion= >=3D 0x00010005: > + if F.Dir not in self.IncludePathList: > self.IncludePathList.insert(0, F.Dir) > RetVal.append(F) >=20 > self._MatchBuildRuleOrder(RetVal) >=20 > @@ -3261,12 +3216,10 @@ class ModuleAutoGen(AutoGen): > @cached_property > def DependentLibraryList(self): > # only merge library classes and PCD for non-library module > if self.IsLibrary: > return [] > - if self.AutoGenVersion < 0x00010005: > - return self.PlatformInfo.ResolveLibraryReference(self.Module= ) > return self.PlatformInfo.ApplyLibraryInstance(self.Module) >=20 > ## Get the list of PCDs from current module > # > # @retval list The list of PCD > @@ -3351,23 +3304,12 @@ class ModuleAutoGen(AutoGen): > # @retval list The list path > # > @cached_property > def IncludePathList(self): > RetVal =3D [] > - if self.AutoGenVersion < 0x00010005: > - for Inc in self.Module.Includes: > - if Inc not in RetVal: > - RetVal.append(Inc) > - # for Edk modules > - Inc =3D path.join(Inc, self.Arch.capitalize()) > - if os.path.exists(Inc) and Inc not in RetVal: > - RetVal.append(Inc) > - # Edk module needs to put DEBUG_DIR at the end of search pat= h and not to use SOURCE_DIR all the time > - RetVal.append(self.DebugDir) > - else: > - RetVal.append(self.MetaFile.Dir) > - RetVal.append(self.DebugDir) > + RetVal.append(self.MetaFile.Dir) > + RetVal.append(self.DebugDir) >=20 > for Package in self.Module.Packages: > PackageDir =3D mws.join(self.WorkspaceDir, Package.MetaFile.= Dir) > if PackageDir not in RetVal: > RetVal.append(PackageDir) > @@ -3526,14 +3468,10 @@ class ModuleAutoGen(AutoGen): > return >=20 > if self.IsAsBuiltInfCreated: > return >=20 > - # Skip the following code for EDK I inf > - if self.AutoGenVersion < 0x00010005: > - return > - > # Skip the following code for libraries > if self.IsLibrary: > return >=20 > # Skip the following code for modules with no source files > @@ -3986,21 +3924,14 @@ class ModuleAutoGen(AutoGen): > AutoGenList =3D [] > IgoredAutoGenList =3D [] >=20 > for File in self.AutoGenFileList: > if GenC.Generate(File.Path, self.AutoGenFileList[File], File= .IsBinary): > - #Ignore Edk AutoGen.c > - if self.AutoGenVersion < 0x00010005 and File.Name =3D=3D= 'AutoGen.c': > - continue > - > AutoGenList.append(str(File)) > else: > IgoredAutoGenList.append(str(File)) >=20 > - # Skip the following code for EDK I inf > - if self.AutoGenVersion < 0x00010005: > - return >=20 > for ModuleType in self.DepexList: > # Ignore empty [depex] section or [depex] section for SUP_MO= DULE_USER_DEFINED module > if len(self.DepexList[ModuleType]) =3D=3D 0 or ModuleType = =3D=3D SUP_MODULE_USER_DEFINED: > continue > diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/P= ython/AutoGen/GenC.py > index 09626d0b96..ffc900fd81 100644 > --- a/BaseTools/Source/Python/AutoGen/GenC.py > +++ b/BaseTools/Source/Python/AutoGen/GenC.py > @@ -1679,26 +1679,10 @@ def CreateUnicodeStringCode(Info, AutoGenC, AutoG= enH, UniGenCFlag, UniGenBinBuff >=20 > IncList =3D [Info.MetaFile.Dir] > # Get all files under [Sources] section in inf file for EDK-II modul= e > EDK2Module =3D True > SrcList =3D [F for F in Info.SourceFileList] > - if Info.AutoGenVersion < 0x00010005: > - EDK2Module =3D False > - # Get all files under the module directory for EDK-I module > - Cwd =3D os.getcwd() > - os.chdir(Info.MetaFile.Dir) > - for Root, Dirs, Files in os.walk("."): > - if 'CVS' in Dirs: > - Dirs.remove('CVS') > - if '.svn' in Dirs: > - Dirs.remove('.svn') > - for File in Files: > - File =3D PathClass(os.path.join(Root, File), Info.MetaFi= le.Dir) > - if File in SrcList: > - continue > - SrcList.append(File) > - os.chdir(Cwd) >=20 > if 'BUILD' in Info.BuildOption and Info.BuildOption['BUILD']['FLAGS'= ].find('-c') > -1: > CompatibleMode =3D True > else: > CompatibleMode =3D False > @@ -1982,46 +1966,45 @@ def CreateHeaderCode(Info, AutoGenC, AutoGenH): > # file header > AutoGenH.Append(gAutoGenHeaderString.Replace({'FileName':'AutoGen.h'= })) > # header file Prologue > AutoGenH.Append(gAutoGenHPrologueString.Replace({'File':'AUTOGENH','= Guid':Info.Guid.replace('-', '_')})) > AutoGenH.Append(gAutoGenHCppPrologueString) > - if Info.AutoGenVersion >=3D 0x00010005: > - # header files includes > - if Info.ModuleType in gModuleTypeHeaderFile: > - AutoGenH.Append("#include <%s>\n" % gModuleTypeHeaderFile[In= fo.ModuleType][0]) > - # > - # if either PcdLib in [LibraryClasses] sections or there exist P= cd section, add PcdLib.h > - # As if modules only uses FixedPcd, then PcdLib is not needed in= [LibraryClasses] section. > - # > - if 'PcdLib' in Info.Module.LibraryClasses or Info.Module.Pcds: > - AutoGenH.Append("#include \n") >=20 > - AutoGenH.Append('\nextern GUID gEfiCallerIdGuid;') > - AutoGenH.Append('\nextern CHAR8 *gEfiCallerBaseName;\n\n') > + # header files includes > + if Info.ModuleType in gModuleTypeHeaderFile: > + AutoGenH.Append("#include <%s>\n" % gModuleTypeHeaderFile[Info.M= oduleType][0]) > + # > + # if either PcdLib in [LibraryClasses] sections or there exist Pcd s= ection, add PcdLib.h > + # As if modules only uses FixedPcd, then PcdLib is not needed in [Li= braryClasses] section. > + # > + if 'PcdLib' in Info.Module.LibraryClasses or Info.Module.Pcds: > + AutoGenH.Append("#include \n") > + > + AutoGenH.Append('\nextern GUID gEfiCallerIdGuid;') > + AutoGenH.Append('\nextern CHAR8 *gEfiCallerBaseName;\n\n') >=20 > - if Info.IsLibrary: > - return > + if Info.IsLibrary: > + return >=20 > - AutoGenH.Append("#define EFI_CALLER_ID_GUID \\\n %s\n" % GuidSt= ringToGuidStructureString(Info.Guid)) > + AutoGenH.Append("#define EFI_CALLER_ID_GUID \\\n %s\n" % GuidString= ToGuidStructureString(Info.Guid)) >=20 > if Info.IsLibrary: > return > # C file header > AutoGenC.Append(gAutoGenHeaderString.Replace({'FileName':'AutoGen.c'= })) > - if Info.AutoGenVersion >=3D 0x00010005: > - # C file header files includes > - if Info.ModuleType in gModuleTypeHeaderFile: > - for Inc in gModuleTypeHeaderFile[Info.ModuleType]: > - AutoGenC.Append("#include <%s>\n" % Inc) > - else: > - AutoGenC.Append("#include <%s>\n" % gBasicHeaderFile) > + # C file header files includes > + if Info.ModuleType in gModuleTypeHeaderFile: > + for Inc in gModuleTypeHeaderFile[Info.ModuleType]: > + AutoGenC.Append("#include <%s>\n" % Inc) > + else: > + AutoGenC.Append("#include <%s>\n" % gBasicHeaderFile) >=20 > - # > - # Publish the CallerId Guid > - # > - AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCaller= IdGuid =3D %s;\n' % > GuidStringToGuidStructureString(Info.Guid)) > - AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED CHAR8 *gEfiCall= erBaseName =3D "%s";\n' % Info.Name) > + # > + # Publish the CallerId Guid > + # > + AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGu= id =3D %s;\n' % > GuidStringToGuidStructureString(Info.Guid)) > + AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED CHAR8 *gEfiCallerBa= seName =3D "%s";\n' % Info.Name) >=20 > ## Create common code for header file > # > # @param Info The ModuleAutoGen object > # @param AutoGenC The TemplateString object for C code > @@ -2043,19 +2026,18 @@ def CreateFooterCode(Info, AutoGenC, AutoGenH): > # @param IdfGenBinBuffer Buffer to store Idf string package data > # > def CreateCode(Info, AutoGenC, AutoGenH, StringH, UniGenCFlag, UniGenBin= Buffer, StringIdf, IdfGenCFlag, IdfGenBinBuffer): > CreateHeaderCode(Info, AutoGenC, AutoGenH) >=20 > - if Info.AutoGenVersion >=3D 0x00010005: > - CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH) > - CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH) > - CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH) > - CreatePcdCode(Info, AutoGenC, AutoGenH) > - CreateLibraryConstructorCode(Info, AutoGenC, AutoGenH) > - CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH) > - CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH) > - CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH) > + CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH) > + CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH) > + CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH) > + CreatePcdCode(Info, AutoGenC, AutoGenH) > + CreateLibraryConstructorCode(Info, AutoGenC, AutoGenH) > + CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH) > + CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH) > + CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH) >=20 > if Info.UnicodeFileList: > FileName =3D "%sStrDefs.h" % Info.Name > StringH.Append(gAutoGenHeaderString.Replace({'FileName':FileName= })) > StringH.Append(gAutoGenHPrologueString.Replace({'File':'STRDEFS'= , 'Guid':Info.Guid.replace('-', '_')})) > @@ -2110,14 +2092,10 @@ def CreateCode(Info, AutoGenC, AutoGenH, StringH,= UniGenCFlag, UniGenBinBuffer, > StringIdf.Append("\n#endif\n") > AutoGenH.Append('#include "%s"\n' % FileName) >=20 > CreateFooterCode(Info, AutoGenC, AutoGenH) >=20 > - # no generation of AutoGen.c for Edk modules without unicode file > - if Info.AutoGenVersion < 0x00010005 and len(Info.UnicodeFileList) = =3D=3D 0: > - AutoGenC.String =3D '' > - > ## Create the code file > # > # @param FilePath The path of code file > # @param Content The content of code file > # @param IsBinaryFile The flag indicating if the file is binary f= ile or not > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Sourc= e/Python/AutoGen/GenMake.py > index ef7bc845d0..4da10e3950 100644 > --- a/BaseTools/Source/Python/AutoGen/GenMake.py > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py > @@ -474,22 +474,15 @@ cleanlib: > if len(MyAgo.Module.ModuleEntryPointList) > 0: > ModuleEntryPoint =3D MyAgo.Module.ModuleEntryPointList[0] > else: > ModuleEntryPoint =3D "_ModuleEntryPoint" >=20 > - # Intel EBC compiler enforces EfiMain > - if MyAgo.AutoGenVersion < 0x00010005 and MyAgo.Arch =3D=3D "EBC"= : > - ArchEntryPoint =3D "EfiMain" > - else: > - ArchEntryPoint =3D ModuleEntryPoint > + ArchEntryPoint =3D ModuleEntryPoint >=20 > if MyAgo.Arch =3D=3D "EBC": > # EBC compiler always use "EfiStart" as entry point. Only ap= plies to EdkII modules > ImageEntryPoint =3D "EfiStart" > - elif MyAgo.AutoGenVersion < 0x00010005: > - # Edk modules use entry point specified in INF file > - ImageEntryPoint =3D ModuleEntryPoint > else: > # EdkII modules always use "_ModuleEntryPoint" as entry poin= t > ImageEntryPoint =3D "_ModuleEntryPoint" >=20 > for k, v in MyAgo.Module.Defines.iteritems(): > @@ -623,15 +616,10 @@ cleanlib: > ListFileName, > "\n".join(self.ListFileMacros[ListFileMacro]), > False > ) >=20 > - # Edk modules need StrDefs.h for string ID > - #if MyAgo.AutoGenVersion < 0x00010005 and len(MyAgo.UnicodeFileL= ist) > 0: > - # BcTargetList =3D ['strdefs'] > - #else: > - # BcTargetList =3D [] > BcTargetList =3D [] >=20 > MakefileName =3D self._FILE_NAME_[self._FileType] > LibraryMakeCommandList =3D [] > for D in self.LibraryBuildDirectoryList: > @@ -1535,17 +1523,13 @@ class TopLevelMakefile(BuildFile): > # TRICK: for not generating GenFds call in makefile if no FDF fi= le > MacroList =3D [] > if MyAgo.FdfFile is not None and MyAgo.FdfFile !=3D "": > FdfFileList =3D [MyAgo.FdfFile] > # macros passed to GenFds > - MacroList.append('"%s=3D%s"' % ("EFI_SOURCE", GlobalData.gEf= iSource.replace('\\', '\\\\'))) > - MacroList.append('"%s=3D%s"' % ("EDK_SOURCE", GlobalData.gEd= kSource.replace('\\', '\\\\'))) > MacroDict =3D {} > MacroDict.update(GlobalData.gGlobalDefines) > MacroDict.update(GlobalData.gCommandLineDefines) > - MacroDict.pop("EFI_SOURCE", "dummy") > - MacroDict.pop("EDK_SOURCE", "dummy") > for MacroName in MacroDict: > if MacroDict[MacroName] !=3D "": > MacroList.append('"%s=3D%s"' % (MacroName, MacroDict= [MacroName].replace('\\', '\\\\'))) > else: > MacroList.append('"%s"' % MacroName) > diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Sourc= e/Python/Common/DataType.py > index 6b375712b6..ec0a4f3d59 100644 > --- a/BaseTools/Source/Python/Common/DataType.py > +++ b/BaseTools/Source/Python/Common/DataType.py > @@ -45,12 +45,10 @@ TAB_GUID =3D 'GUID' >=20 > TAB_PCD_CLEAN_NUMERIC_TYPES =3D {TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_= UINT64} > TAB_PCD_NUMERIC_TYPES =3D {TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64= , 'BOOLEAN'} > TAB_PCD_NUMERIC_TYPES_VOID =3D {TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_U= INT64, 'BOOLEAN', TAB_VOID} >=20 > -TAB_EDK_SOURCE =3D '$(EDK_SOURCE)' > -TAB_EFI_SOURCE =3D '$(EFI_SOURCE)' > TAB_WORKSPACE =3D '$(WORKSPACE)' > TAB_FV_DIRECTORY =3D 'FV' >=20 > TAB_ARCH_NULL =3D '' > TAB_ARCH_COMMON =3D 'COMMON' > diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Sou= rce/Python/Common/GlobalData.py > index 57048bcae6..5eaee06694 100644 > --- a/BaseTools/Source/Python/Common/GlobalData.py > +++ b/BaseTools/Source/Python/Common/GlobalData.py > @@ -11,17 +11,11 @@ > # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. >=20 > import re >=20 > gIsWindows =3D None > - > -gEdkCompatibilityPkg =3D "EdkCompatibilityPkg" > gWorkspace =3D "." > -gEdkSource =3D "EdkCompatibilityPkg" > -gEfiSource =3D "." > -gEcpSource =3D "EdkCompatibilityPkg" > - > gOptions =3D None > gCaseInsensitive =3D False > gAllFiles =3D None > gCommand =3D None > gSKUID_CMD =3D None > diff --git a/BaseTools/Source/Python/Workspace/DecBuildData.py b/BaseTool= s/Source/Python/Workspace/DecBuildData.py > index cc00409fee..b64cbb6b50 100644 > --- a/BaseTools/Source/Python/Workspace/DecBuildData.py > +++ b/BaseTools/Source/Python/Workspace/DecBuildData.py > @@ -296,11 +296,10 @@ class DecBuildData(PackageBuildClassObject): > self._Includes =3D [] > self._PrivateIncludes =3D [] > PublicInclues =3D [] > RecordList =3D self._RawData[MODEL_EFI_INCLUDE, self._Arch] > Macros =3D self._Macros > - Macros["EDK_SOURCE"] =3D GlobalData.gEcpSource > for Record in RecordList: > File =3D PathClass(NormPath(Record[0], Macros), self._Pa= ckageDir, Arch=3Dself._Arch) > LineNo =3D Record[-1] > # validate the path > ErrorCode, ErrorInfo =3D File.Validate() > diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTool= s/Source/Python/Workspace/DscBuildData.py > index 7e82e8e934..baca4e9e6b 100644 > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > @@ -713,11 +713,10 @@ class DscBuildData(PlatformBuildClassObject): > return self._Modules >=20 > self._Modules =3D OrderedDict() > RecordList =3D self._RawData[MODEL_META_DATA_COMPONENT, self._Ar= ch] > Macros =3D self._Macros > - Macros["EDK_SOURCE"] =3D GlobalData.gEcpSource > for Record in RecordList: > DuplicatedFile =3D False >=20 > ModuleFile =3D PathClass(NormPath(Record[0], Macros), Global= Data.gWorkspace, Arch=3Dself._Arch) > ModuleId =3D Record[6] > @@ -856,12 +855,10 @@ class DscBuildData(PlatformBuildClassObject): > LibraryInstance =3D LibraryClassDict[self._Arch, Mod= uleType, LibraryClass] > if LibraryInstance is None: > continue > self._LibraryClasses[LibraryClass, ModuleType] =3D L= ibraryInstance >=20 > - # for Edk style library instances, which are listed in diffe= rent section > - Macros["EDK_SOURCE"] =3D GlobalData.gEcpSource > RecordList =3D self._RawData[MODEL_EFI_LIBRARY_INSTANCE, sel= f._Arch] > for Record in RecordList: > File =3D PathClass(NormPath(Record[0], Macros), GlobalDa= ta.gWorkspace, Arch=3Dself._Arch) > LineNo =3D Record[-1] > # check the file validation > diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTool= s/Source/Python/Workspace/InfBuildData.py > index 99bbecfd1f..02d6c1c756 100644 > --- a/BaseTools/Source/Python/Workspace/InfBuildData.py > +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py > @@ -143,14 +143,10 @@ class InfBuildData(ModuleBuildClassObject): >=20 > ## Get current effective macros > @cached_property > def _Macros(self): > RetVal =3D {} > - # EDK_GLOBAL defined macros can be applied to EDK module > - if self.AutoGenVersion < 0x00010005: > - RetVal.update(GlobalData.gEdkGlobal) > - RetVal.update(GlobalData.gGlobalDefines) > return RetVal >=20 > ## Get architecture > @cached_property > def Arch(self): > @@ -244,110 +240,54 @@ class InfBuildData(ModuleBuildClassObject): > self._Macros[Name] =3D Value >=20 > # > # Retrieve information in sections specific to Edk.x modules > # > - if self.AutoGenVersion >=3D 0x00010005: > - if not self._ModuleType: > - EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, > - "MODULE_TYPE is not given", File=3Dself.= MetaFile) > - if self._ModuleType not in SUP_MODULE_LIST: > - RecordList =3D self._RawData[MODEL_META_DATA_HEADER, sel= f._Arch, self._Platform] > - for Record in RecordList: > - Name =3D Record[1] > - if Name =3D=3D "MODULE_TYPE": > - LineNo =3D Record[6] > - break > - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, > - "MODULE_TYPE %s is not supported for EDK= II, valid values are:\n %s" % (self._ModuleType, ' > '.join(l for l in SUP_MODULE_LIST)), > - File=3Dself.MetaFile, Line=3DLineNo) > - if (self._Specification is None) or (not 'PI_SPECIFICATION_V= ERSION' in self._Specification) or > (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x0001000A): > - if self._ModuleType =3D=3D SUP_MODULE_SMM_CORE: > - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "SMM_= CORE module type can't be used in the module > with PI_SPECIFICATION_VERSION less than 0x0001000A", File=3Dself.MetaFile= ) > - if (self._Specification is None) or (not 'PI_SPECIFICATION_V= ERSION' in self._Specification) or > (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x00010032): > - if self._ModuleType =3D=3D SUP_MODULE_MM_CORE_STANDALONE= : > - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_C= ORE_STANDALONE module type can't be used in > the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=3Dse= lf.MetaFile) > - if self._ModuleType =3D=3D SUP_MODULE_MM_STANDALONE: > - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_S= TANDALONE module type can't be used in the > module with PI_SPECIFICATION_VERSION less than 0x00010032", File=3Dself.M= etaFile) > - if 'PCI_DEVICE_ID' in self._Defs and 'PCI_VENDOR_ID' in self= ._Defs \ > - and 'PCI_CLASS_CODE' in self._Defs and 'PCI_REVISION' in = self._Defs: > - self._BuildType =3D 'UEFI_OPTIONROM' > - if 'PCI_COMPRESS' in self._Defs: > - if self._Defs['PCI_COMPRESS'] not in ('TRUE', 'FALSE= '): > - EdkLogger.error("build", FORMAT_INVALID, "Expect= ed TRUE/FALSE for PCI_COMPRESS: %s" % > self.MetaFile) > - > - elif 'UEFI_HII_RESOURCE_SECTION' in self._Defs \ > - and self._Defs['UEFI_HII_RESOURCE_SECTION'] =3D=3D 'TRUE'= : > - self._BuildType =3D 'UEFI_HII' > - else: > - self._BuildType =3D self._ModuleType.upper() > - > - if self._DxsFile: > - File =3D PathClass(NormPath(self._DxsFile), self._Module= Dir, Arch=3Dself._Arch) > - # check the file validation > - ErrorCode, ErrorInfo =3D File.Validate(".dxs", CaseSensi= tive=3DFalse) > - if ErrorCode !=3D 0: > - EdkLogger.error('build', ErrorCode, ExtraData=3DErro= rInfo, > - File=3Dself.MetaFile, Line=3DLineNo) > - if not self._DependencyFileList: > - self._DependencyFileList =3D [] > - self._DependencyFileList.append(File) > + if not self._ModuleType: > + EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, > + "MODULE_TYPE is not given", File=3Dself.Meta= File) > + if self._ModuleType not in SUP_MODULE_LIST: > + RecordList =3D self._RawData[MODEL_META_DATA_HEADER, self._A= rch, self._Platform] > + for Record in RecordList: > + Name =3D Record[1] > + if Name =3D=3D "MODULE_TYPE": > + LineNo =3D Record[6] > + break > + EdkLogger.error("build", FORMAT_NOT_SUPPORTED, > + "MODULE_TYPE %s is not supported for EDK II,= valid values are:\n %s" % (self._ModuleType, ' '.join(l > for l in SUP_MODULE_LIST)), > + File=3Dself.MetaFile, Line=3DLineNo) > + if (self._Specification is None) or (not 'PI_SPECIFICATION_VERSI= ON' in self._Specification) or > (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x0001000A): > + if self._ModuleType =3D=3D SUP_MODULE_SMM_CORE: > + EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "SMM_CORE= module type can't be used in the module with > PI_SPECIFICATION_VERSION less than 0x0001000A", File=3Dself.MetaFile) > + if (self._Specification is None) or (not 'PI_SPECIFICATION_VERSI= ON' in self._Specification) or > (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x00010032): > + if self._ModuleType =3D=3D SUP_MODULE_MM_CORE_STANDALONE: > + EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_CORE_= STANDALONE module type can't be used in the > module with PI_SPECIFICATION_VERSION less than 0x00010032", File=3Dself.M= etaFile) > + if self._ModuleType =3D=3D SUP_MODULE_MM_STANDALONE: > + EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_STAND= ALONE module type can't be used in the module > with PI_SPECIFICATION_VERSION less than 0x00010032", File=3Dself.MetaFile= ) > + if 'PCI_DEVICE_ID' in self._Defs and 'PCI_VENDOR_ID' in self._De= fs \ > + and 'PCI_CLASS_CODE' in self._Defs and 'PCI_REVISION' in self= ._Defs: > + self._BuildType =3D 'UEFI_OPTIONROM' > + if 'PCI_COMPRESS' in self._Defs: > + if self._Defs['PCI_COMPRESS'] not in ('TRUE', 'FALSE'): > + EdkLogger.error("build", FORMAT_INVALID, "Expected T= RUE/FALSE for PCI_COMPRESS: %s" % self.MetaFile) > + > + elif 'UEFI_HII_RESOURCE_SECTION' in self._Defs \ > + and self._Defs['UEFI_HII_RESOURCE_SECTION'] =3D=3D 'TRUE': > + self._BuildType =3D 'UEFI_HII' > else: > - if not self._ComponentType: > - EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, > - "COMPONENT_TYPE is not given", File=3Dse= lf.MetaFile) > - self._BuildType =3D self._ComponentType.upper() > - if self._ComponentType in COMPONENT_TO_MODULE_MAP_DICT: > - self._ModuleType =3D COMPONENT_TO_MODULE_MAP_DICT[self._= ComponentType] > - if self._ComponentType =3D=3D EDK_COMPONENT_TYPE_LIBRARY: > - self._LibraryClass =3D [LibraryClassObject(self._BaseNam= e, SUP_MODULE_LIST)] > - # make use some [nmake] section macros > - Macros =3D self._Macros > - Macros["EDK_SOURCE"] =3D GlobalData.gEcpSource > - Macros['PROCESSOR'] =3D self._Arch > - RecordList =3D self._RawData[MODEL_META_DATA_NMAKE, self._Ar= ch, self._Platform] > - for Name, Value, Dummy, Arch, Platform, ID, LineNo in Record= List: > - Value =3D ReplaceMacro(Value, Macros, True) > - if Name =3D=3D "IMAGE_ENTRY_POINT": > - if self._ModuleEntryPointList is None: > - self._ModuleEntryPointList =3D [] > - self._ModuleEntryPointList.append(Value) > - elif Name =3D=3D "DPX_SOURCE": > - File =3D PathClass(NormPath(Value), self._ModuleDir,= Arch=3Dself._Arch) > - # check the file validation > - ErrorCode, ErrorInfo =3D File.Validate(".dxs", CaseS= ensitive=3DFalse) > - if ErrorCode !=3D 0: > - EdkLogger.error('build', ErrorCode, ExtraData=3D= ErrorInfo, > - File=3Dself.MetaFile, Line=3DLin= eNo) > - if not self._DependencyFileList: > - self._DependencyFileList =3D [] > - self._DependencyFileList.append(File) > - else: > - ToolList =3D self._NMAKE_FLAG_PATTERN_.findall(Name) > - if len(ToolList) =3D=3D 1: > - if self._BuildOptions is None: > - self._BuildOptions =3D OrderedDict() > + self._BuildType =3D self._ModuleType.upper() >=20 > - if ToolList[0] in self._TOOL_CODE_: > - Tool =3D self._TOOL_CODE_[ToolList[0]] > - else: > - Tool =3D ToolList[0] > - ToolChain =3D "*_*_*_%s_FLAGS" % Tool > - # Edk.x only support MSFT tool chain > - # ignore not replaced macros in value > - ValueList =3D GetSplitList(' ' + Value, '/D') > - Dummy =3D ValueList[0] > - for Index in range(1, len(ValueList)): > - if ValueList[Index][-1] =3D=3D '=3D' or Valu= eList[Index] =3D=3D '': > - continue > - Dummy =3D Dummy + ' /D ' + ValueList[Index] > - Value =3D Dummy.strip() > - if (TAB_COMPILER_MSFT, ToolChain) not in self._B= uildOptions: > - self._BuildOptions[TAB_COMPILER_MSFT, ToolCh= ain] =3D Value > - else: > - OptionString =3D self._BuildOptions[TAB_COMP= ILER_MSFT, ToolChain] > - self._BuildOptions[TAB_COMPILER_MSFT, ToolCh= ain] =3D OptionString + " " + Value > + if self._DxsFile: > + File =3D PathClass(NormPath(self._DxsFile), self._ModuleDir,= Arch=3Dself._Arch) > + # check the file validation > + ErrorCode, ErrorInfo =3D File.Validate(".dxs", CaseSensitive= =3DFalse) > + if ErrorCode !=3D 0: > + EdkLogger.error('build', ErrorCode, ExtraData=3DErrorInf= o, > + File=3Dself.MetaFile, Line=3DLineNo) > + if not self._DependencyFileList: > + self._DependencyFileList =3D [] > + self._DependencyFileList.append(File) >=20 > ## Retrieve file version > @cached_property > def AutoGenVersion(self): > RetVal =3D 0x00010000 > @@ -522,11 +462,10 @@ class InfBuildData(ModuleBuildClassObject): > @cached_class_function > def _GetBinaries(self): > RetVal =3D [] > RecordList =3D self._RawData[MODEL_EFI_BINARY_FILE, self._Arch, = self._Platform] > Macros =3D self._Macros > - Macros["EDK_SOURCE"] =3D GlobalData.gEcpSource > Macros['PROCESSOR'] =3D self._Arch > for Record in RecordList: > FileType =3D Record[0] > LineNo =3D Record[-1] > Target =3D TAB_COMMON > @@ -570,35 +509,17 @@ class InfBuildData(ModuleBuildClassObject): > for Record in RecordList: > LineNo =3D Record[-1] > ToolChainFamily =3D Record[1] > TagName =3D Record[2] > ToolCode =3D Record[3] > - if self.AutoGenVersion < 0x00010005: > - Macros["EDK_SOURCE"] =3D GlobalData.gEcpSource > - Macros['PROCESSOR'] =3D self._Arch > - SourceFile =3D NormPath(Record[0], Macros) > - if SourceFile[0] =3D=3D os.path.sep: > - SourceFile =3D mws.join(GlobalData.gWorkspace, Sourc= eFile[1:]) > - # old module source files (Edk) > - File =3D PathClass(SourceFile, self._ModuleDir, self._So= urceOverridePath, > - '', False, self._Arch, ToolChainFamily,= '', TagName, ToolCode) > - # check the file validation > - ErrorCode, ErrorInfo =3D File.Validate(CaseSensitive=3DF= alse) > - if ErrorCode !=3D 0: > - if File.Ext.lower() =3D=3D '.h': > - EdkLogger.warn('build', 'Include file not found'= , ExtraData=3DErrorInfo, > - File=3Dself.MetaFile, Line=3DLine= No) > - continue > - else: > - EdkLogger.error('build', ErrorCode, ExtraData=3D= File, File=3Dself.MetaFile, Line=3DLineNo) > - else: > - File =3D PathClass(NormPath(Record[0], Macros), self._Mo= duleDir, '', > - '', False, self._Arch, ToolChainFamily,= '', TagName, ToolCode) > - # check the file validation > - ErrorCode, ErrorInfo =3D File.Validate() > - if ErrorCode !=3D 0: > - EdkLogger.error('build', ErrorCode, ExtraData=3DErro= rInfo, File=3Dself.MetaFile, Line=3DLineNo) > + > + File =3D PathClass(NormPath(Record[0], Macros), self._Module= Dir, '', > + '', False, self._Arch, ToolChainFamily, '',= TagName, ToolCode) > + # check the file validation > + ErrorCode, ErrorInfo =3D File.Validate() > + if ErrorCode !=3D 0: > + EdkLogger.error('build', ErrorCode, ExtraData=3DErrorInf= o, File=3Dself.MetaFile, Line=3DLineNo) >=20 > RetVal.append(File) > # add any previously found dependency files to the source list > if self._DependencyFileList: > RetVal.extend(self._DependencyFileList) > @@ -714,22 +635,20 @@ class InfBuildData(ModuleBuildClassObject): > Macros =3D self._Macros > Macros['PROCESSOR'] =3D GlobalData.gEdkGlobal.get('PROCESSOR', s= elf._Arch) > RecordList =3D self._RawData[MODEL_EFI_INCLUDE, self._Arch, self= ._Platform] > for Record in RecordList: > if Record[0].find('EDK_SOURCE') > -1: > - Macros['EDK_SOURCE'] =3D GlobalData.gEcpSource > File =3D NormPath(Record[0], self._Macros) > if File[0] =3D=3D '.': > File =3D os.path.join(self._ModuleDir, File) > else: > File =3D os.path.join(GlobalData.gWorkspace, File) > File =3D RealPath(os.path.normpath(File)) > if File: > RetVal.append(File) >=20 > # TRICK: let compiler to choose correct header file > - Macros['EDK_SOURCE'] =3D GlobalData.gEdkSource > File =3D NormPath(Record[0], self._Macros) > if File[0] =3D=3D '.': > File =3D os.path.join(self._ModuleDir, File) > else: > File =3D os.path.join(GlobalData.gWorkspace, File) > @@ -743,30 +662,18 @@ class InfBuildData(ModuleBuildClassObject): > else: > File =3D mws.join(GlobalData.gWorkspace, File) > File =3D RealPath(os.path.normpath(File)) > if File: > RetVal.append(File) > - if not File and Record[0].find('EFI_SOURCE') > -1: > - # tricky to regard WorkSpace as EFI_SOURCE > - Macros['EFI_SOURCE'] =3D GlobalData.gWorkspace > - File =3D NormPath(Record[0], Macros) > - if File[0] =3D=3D '.': > - File =3D os.path.join(self._ModuleDir, File) > - else: > - File =3D os.path.join(GlobalData.gWorkspace, Fil= e) > - File =3D RealPath(os.path.normpath(File)) > - if File: > - RetVal.append(File) > return RetVal >=20 > ## Retrieve packages this module depends on > @cached_property > def Packages(self): > RetVal =3D [] > RecordList =3D self._RawData[MODEL_META_DATA_PACKAGE, self._Arch= , self._Platform] > Macros =3D self._Macros > - Macros['EDK_SOURCE'] =3D GlobalData.gEcpSource > for Record in RecordList: > File =3D PathClass(NormPath(Record[0], Macros), GlobalData.g= Workspace, Arch=3Dself._Arch) > # check the file validation > ErrorCode, ErrorInfo =3D File.Validate('.dec') > if ErrorCode !=3D 0: > diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTo= ols/Source/Python/Workspace/MetaFileParser.py > index 032220813b..9b35cffcd2 100644 > --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py > +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py > @@ -683,22 +683,10 @@ class InfParser(MetaFileParser): > if Macros: > for Index in range(0, len(self._ValueList)): > Value =3D self._ValueList[Index] > if not Value: > continue > - > - if Value.upper().find('$(EFI_SOURCE)\Edk'.upper()) > -1 = or Value.upper().find('$(EFI_SOURCE)/Edk'.upper()) > -1: > - Value =3D '$(EDK_SOURCE)' + Value[17:] > - if Value.find('$(EFI_SOURCE)') > -1 or Value.find('$(EDK= _SOURCE)') > -1: > - pass > - elif Value.startswith('.'): > - pass > - elif Value.startswith('$('): > - pass > - else: > - Value =3D '$(EFI_SOURCE)/' + Value > - > self._ValueList[Index] =3D ReplaceMacro(Value, Macros) >=20 > ## Parse [Sources] section > # > # Only path can have macro used. So we need to replace them before= use. > @@ -1592,20 +1580,10 @@ class DscParser(MetaFileParser): > __IncludeMacros =3D {} > # > # Allow using system environment variables in path after !i= nclude > # > __IncludeMacros['WORKSPACE'] =3D GlobalData.gGlobalDefines['= WORKSPACE'] > - if "ECP_SOURCE" in GlobalData.gGlobalDefines: > - __IncludeMacros['ECP_SOURCE'] =3D GlobalData.gGlobalDefi= nes['ECP_SOURCE'] > - # > - # During GenFds phase call DSC parser, will go into this bra= nch. > - # > - elif "ECP_SOURCE" in GlobalData.gCommandLineDefines: > - __IncludeMacros['ECP_SOURCE'] =3D GlobalData.gCommandLin= eDefines['ECP_SOURCE'] > - > - __IncludeMacros['EFI_SOURCE'] =3D GlobalData.gGlobalDefines[= 'EFI_SOURCE'] > - __IncludeMacros['EDK_SOURCE'] =3D GlobalData.gGlobalDefines[= 'EDK_SOURCE'] > # > # Allow using MACROs comes from [Defines] section to keep co= mpatible. > # > __IncludeMacros.update(self._Macros) >=20 > diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseT= ools/Source/Python/Workspace/WorkspaceCommon.py > index 55d01fa4b2..ee238e5143 100644 > --- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py > +++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py > @@ -88,14 +88,11 @@ def GetDeclaredPcd(Platform, BuildDatabase, Arch, Tar= get, Toolchain, additionalP > # @param Target: Current target > # @param Toolchain: Current toolchain > # @retval: List of dependent libraries which are InfBuildData instances > # > def GetLiabraryInstances(Module, Platform, BuildDatabase, Arch, Target, = Toolchain): > - if Module.AutoGenVersion >=3D 0x00010005: > - return GetModuleLibInstances(Module, Platform, BuildDatabase, Ar= ch, Target, Toolchain) > - else: > - return _ResolveLibraryReference(Module, Platform) > + return GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, = Target, Toolchain) >=20 > def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target,= Toolchain, FileName =3D '', EdkLogger =3D None): > ModuleType =3D Module.ModuleType >=20 > # add forced library instances (specified under LibraryClasses secti= ons) > @@ -253,29 +250,5 @@ def GetModuleLibInstances(Module, Platform, BuildDat= abase, Arch, Target, Toolcha > # Build the list of constructor and destructir names > # The DAG Topo sort produces the destructor order, so the list of co= nstructors must generated in the reverse order > # > SortedLibraryList.reverse() > return SortedLibraryList > - > -def _ResolveLibraryReference(Module, Platform): > - LibraryConsumerList =3D [Module] > - > - # "CompilerStub" is a must for Edk modules > - if Module.Libraries: > - Module.Libraries.append("CompilerStub") > - LibraryList =3D [] > - while len(LibraryConsumerList) > 0: > - M =3D LibraryConsumerList.pop() > - for LibraryName in M.Libraries: > - Library =3D Platform.LibraryClasses[LibraryName, ':dummy:'] > - if Library is None: > - for Key in Platform.LibraryClasses.data: > - if LibraryName.upper() =3D=3D Key.upper(): > - Library =3D Platform.LibraryClasses[Key, ':dummy= :'] > - break > - if Library is None: > - continue > - > - if Library not in LibraryList: > - LibraryList.append(Library) > - LibraryConsumerList.append(Library) > - return LibraryList > diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sou= rce/Python/build/BuildReport.py > index 3f3c1a12f1..654a69e05c 100644 > --- a/BaseTools/Source/Python/build/BuildReport.py > +++ b/BaseTools/Source/Python/build/BuildReport.py > @@ -330,14 +330,10 @@ class LibraryReport(object): > # @param self The object pointer > # @param M Module context information > # > def __init__(self, M): > self.LibraryList =3D [] > - if int(str(M.AutoGenVersion), 0) >=3D 0x00010005: > - self._EdkIIModule =3D True > - else: > - self._EdkIIModule =3D False >=20 > for Lib in M.DependentLibraryList: > LibInfPath =3D str(Lib) > LibClassList =3D Lib.LibraryClass[0].LibraryClass > LibConstructorList =3D Lib.ConstructorList > @@ -366,32 +362,27 @@ class LibraryReport(object): > FileWrite(File, gSubSectionSep) > for LibraryItem in self.LibraryList: > LibInfPath =3D LibraryItem[0] > FileWrite(File, LibInfPath) >=20 > - # > - # Report library class, library constructor and destruct= or for > - # EDKII style module. > - # > - if self._EdkIIModule: > - LibClass =3D LibraryItem[1] > - EdkIILibInfo =3D "" > - LibConstructor =3D " ".join(LibraryItem[2]) > - if LibConstructor: > - EdkIILibInfo +=3D " C =3D " + LibConstructor > - LibDestructor =3D " ".join(LibraryItem[3]) > - if LibDestructor: > - EdkIILibInfo +=3D " D =3D " + LibDestructor > - LibDepex =3D " ".join(LibraryItem[4]) > - if LibDepex: > - EdkIILibInfo +=3D " Depex =3D " + LibDepex > - if LibraryItem[5]: > - EdkIILibInfo +=3D " Time =3D " + LibraryItem[5] > - if EdkIILibInfo: > - FileWrite(File, "{%s: %s}" % (LibClass, EdkIILib= Info)) > - else: > - FileWrite(File, "{%s}" % LibClass) > + LibClass =3D LibraryItem[1] > + EdkIILibInfo =3D "" > + LibConstructor =3D " ".join(LibraryItem[2]) > + if LibConstructor: > + EdkIILibInfo +=3D " C =3D " + LibConstructor > + LibDestructor =3D " ".join(LibraryItem[3]) > + if LibDestructor: > + EdkIILibInfo +=3D " D =3D " + LibDestructor > + LibDepex =3D " ".join(LibraryItem[4]) > + if LibDepex: > + EdkIILibInfo +=3D " Depex =3D " + LibDepex > + if LibraryItem[5]: > + EdkIILibInfo +=3D " Time =3D " + LibraryItem[5] > + if EdkIILibInfo: > + FileWrite(File, "{%s: %s}" % (LibClass, EdkIILibInfo= )) > + else: > + FileWrite(File, "{%s}" % LibClass) >=20 > FileWrite(File, gSubSectionEnd) >=20 > ## > # Reports dependency expression information > @@ -1544,19 +1535,12 @@ class PredictionReport(object): > for Guid in Module.GuidList: > self._GuidMap[Guid] =3D GuidStructureStringToGuidStr= ing(Module.GuidList[Guid]) >=20 > if Module.Guid and not Module.IsLibrary: > EntryPoint =3D " ".join(Module.Module.ModuleEntryPoi= ntList) > - if int(str(Module.AutoGenVersion), 0) >=3D 0x0001000= 5: > - RealEntryPoint =3D "_ModuleEntryPoint" > - else: > - RealEntryPoint =3D EntryPoint > - if EntryPoint =3D=3D "_ModuleEntryPoint": > - CCFlags =3D Module.BuildOption.get("CC", {})= .get("FLAGS", "") > - Match =3D gGlueLibEntryPoint.search(CCFlags) > - if Match: > - EntryPoint =3D Match.group(1) > + > + RealEntryPoint =3D "_ModuleEntryPoint" >=20 > self._FfsEntryPoint[Module.Guid.upper()] =3D (EntryP= oint, RealEntryPoint) >=20 >=20 > # > diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Py= thon/build/build.py > index 97271e634e..b550bbc3b2 100644 > --- a/BaseTools/Source/Python/build/build.py > +++ b/BaseTools/Source/Python/build/build.py > @@ -120,69 +120,13 @@ def CheckEnvVariable(): > if not os.path.exists(Path): > EdkLogger.error("build", FILE_NOT_FOUND, "One Path in PA= CKAGES_PATH doesn't exist", ExtraData=3DPath) > elif ' ' in Path: > EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space= is allowed in PACKAGES_PATH", ExtraData=3DPath) >=20 > - # > - # Check EFI_SOURCE (Edk build convention). EDK_SOURCE will always po= int to ECP > - # > - if "ECP_SOURCE" not in os.environ: > - os.environ["ECP_SOURCE"] =3D mws.join(WorkspaceDir, GlobalData.g= EdkCompatibilityPkg) > - if "EFI_SOURCE" not in os.environ: > - os.environ["EFI_SOURCE"] =3D os.environ["ECP_SOURCE"] > - if "EDK_SOURCE" not in os.environ: > - os.environ["EDK_SOURCE"] =3D os.environ["ECP_SOURCE"] > - > - # > - # Unify case of characters on case-insensitive systems > - # > - EfiSourceDir =3D os.path.normcase(os.path.normpath(os.environ["EFI_S= OURCE"])) > - EdkSourceDir =3D os.path.normcase(os.path.normpath(os.environ["EDK_S= OURCE"])) > - EcpSourceDir =3D os.path.normcase(os.path.normpath(os.environ["ECP_S= OURCE"])) >=20 > - os.environ["EFI_SOURCE"] =3D EfiSourceDir > - os.environ["EDK_SOURCE"] =3D EdkSourceDir > - os.environ["ECP_SOURCE"] =3D EcpSourceDir > os.environ["EDK_TOOLS_PATH"] =3D os.path.normcase(os.environ["EDK_TO= OLS_PATH"]) >=20 > - if not os.path.exists(EcpSourceDir): > - EdkLogger.verbose("ECP_SOURCE =3D %s doesn't exist. Edk modules = could not be built." % EcpSourceDir) > - elif ' ' in EcpSourceDir: > - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allo= wed in ECP_SOURCE path", > - ExtraData=3DEcpSourceDir) > - if not os.path.exists(EdkSourceDir): > - if EdkSourceDir =3D=3D EcpSourceDir: > - EdkLogger.verbose("EDK_SOURCE =3D %s doesn't exist. Edk modu= les could not be built." % EdkSourceDir) > - else: > - EdkLogger.error("build", PARAMETER_INVALID, "EDK_SOURCE does= not exist", > - ExtraData=3DEdkSourceDir) > - elif ' ' in EdkSourceDir: > - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allo= wed in EDK_SOURCE path", > - ExtraData=3DEdkSourceDir) > - if not os.path.exists(EfiSourceDir): > - if EfiSourceDir =3D=3D EcpSourceDir: > - EdkLogger.verbose("EFI_SOURCE =3D %s doesn't exist. Edk modu= les could not be built." % EfiSourceDir) > - else: > - EdkLogger.error("build", PARAMETER_INVALID, "EFI_SOURCE does= not exist", > - ExtraData=3DEfiSourceDir) > - elif ' ' in EfiSourceDir: > - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allo= wed in EFI_SOURCE path", > - ExtraData=3DEfiSourceDir) > - > - # check those variables on single workspace case > - if not PackagesPath: > - # change absolute path to relative path to WORKSPACE > - if EfiSourceDir.upper().find(WorkspaceDir.upper()) !=3D 0: > - EdkLogger.error("build", PARAMETER_INVALID, "EFI_SOURCE is n= ot under WORKSPACE", > - ExtraData=3D"WORKSPACE =3D %s\n EFI_SOURC= E =3D %s" % (WorkspaceDir, EfiSourceDir)) > - if EdkSourceDir.upper().find(WorkspaceDir.upper()) !=3D 0: > - EdkLogger.error("build", PARAMETER_INVALID, "EDK_SOURCE is n= ot under WORKSPACE", > - ExtraData=3D"WORKSPACE =3D %s\n EDK_SOURC= E =3D %s" % (WorkspaceDir, EdkSourceDir)) > - if EcpSourceDir.upper().find(WorkspaceDir.upper()) !=3D 0: > - EdkLogger.error("build", PARAMETER_INVALID, "ECP_SOURCE is n= ot under WORKSPACE", > - ExtraData=3D"WORKSPACE =3D %s\n ECP_SOURC= E =3D %s" % (WorkspaceDir, EcpSourceDir)) > - > # check EDK_TOOLS_PATH > if "EDK_TOOLS_PATH" not in os.environ: > EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "Environment v= ariable not found", > ExtraData=3D"EDK_TOOLS_PATH") >=20 > @@ -190,18 +134,12 @@ def CheckEnvVariable(): > if "PATH" not in os.environ: > EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "Environment v= ariable not found", > ExtraData=3D"PATH") >=20 > GlobalData.gWorkspace =3D WorkspaceDir > - GlobalData.gEfiSource =3D EfiSourceDir > - GlobalData.gEdkSource =3D EdkSourceDir > - GlobalData.gEcpSource =3D EcpSourceDir >=20 > GlobalData.gGlobalDefines["WORKSPACE"] =3D WorkspaceDir > - GlobalData.gGlobalDefines["EFI_SOURCE"] =3D EfiSourceDir > - GlobalData.gGlobalDefines["EDK_SOURCE"] =3D EdkSourceDir > - GlobalData.gGlobalDefines["ECP_SOURCE"] =3D EcpSourceDir > GlobalData.gGlobalDefines["EDK_TOOLS_PATH"] =3D os.environ["EDK_TOOL= S_PATH"] >=20 > ## Get normalized file path > # > # Convert the path to be local format, and remove the WORKSPACE path at = the > @@ -846,13 +784,10 @@ class Build(): > # print current build environment and configuration > EdkLogger.quiet("%-16s =3D %s" % ("WORKSPACE", os.environ["WORKS= PACE"])) > if "PACKAGES_PATH" in os.environ: > # WORKSPACE env has been converted before. Print the same pa= th style with WORKSPACE env. > EdkLogger.quiet("%-16s =3D %s" % ("PACKAGES_PATH", > os.path.normcase(os.path.normpath(os.environ["PACKAGES_PATH"])))) > - EdkLogger.quiet("%-16s =3D %s" % ("ECP_SOURCE", os.environ["ECP_= SOURCE"])) > - EdkLogger.quiet("%-16s =3D %s" % ("EDK_SOURCE", os.environ["EDK_= SOURCE"])) > - EdkLogger.quiet("%-16s =3D %s" % ("EFI_SOURCE", os.environ["EFI_= SOURCE"])) > EdkLogger.quiet("%-16s =3D %s" % ("EDK_TOOLS_PATH", os.environ["= EDK_TOOLS_PATH"])) > if "EDK_TOOLS_BIN" in os.environ: > # Print the same path style with WORKSPACE env. > EdkLogger.quiet("%-16s =3D %s" % ("EDK_TOOLS_BIN", > os.path.normcase(os.path.normpath(os.environ["EDK_TOOLS_BIN"])))) > EdkLogger.quiet("%-16s =3D %s" % ("CONF_PATH", GlobalData.gConfD= irectory)) > diff --git a/edksetup.bat b/edksetup.bat > index c32755a471..57b5a8c868 100755 > --- a/edksetup.bat > +++ b/edksetup.bat > @@ -40,15 +40,12 @@ if %WORKSPACE% =3D=3D %CD% ( > goto ParseArgs > ) >=20 > :SetWorkSpace > @REM set new workspace > -@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace > if not defined WORKSPACE ( > set WORKSPACE=3D%CD% > - set EFI_SOURCE=3D > - set EDK_SOURCE=3D > ) >=20 > :ParseArgs > if /I "%1"=3D=3D"-h" goto Usage > if /I "%1"=3D=3D"-help" goto Usage > -- > 2.19.1.windows.1