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.120; helo=mga04.intel.com; envelope-from=yunhuax.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 4BE542267F0F0 for ; Mon, 9 Apr 2018 18:12:59 -0700 (PDT) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Apr 2018 18:12:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,429,1517904000"; d="dat'59?scan'59,208,59";a="40759948" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 09 Apr 2018 18:12:58 -0700 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Apr 2018 18:12:58 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Apr 2018 18:12:51 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.184]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.43]) with mapi id 14.03.0319.002; Tue, 10 Apr 2018 09:12:49 +0800 From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" CC: "Zhu, Yonghong" , "Gao, Liming" Thread-Topic: [PATCH 3/3] BaseTools: fix --genfds-multi-thread generate makefile issue Thread-Index: AdPQaQpK5nH++x32S4+7mrlDlaLprA== Date: Tue, 10 Apr 2018 01:12:49 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC484BAB6@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <47C64442C08CCD4089DC43B6B5E46BC484BAB6@shsmsx102.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.26 Subject: [PATCH 3/3] BaseTools: fix --genfds-multi-thread generate makefile issue 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: Tue, 10 Apr 2018 01:12:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 1. when inf file is binary module, not generate makefile, so need generate ffs with previous method. 2. generate Ui section maybe override and the string is not $(MODULE_NAME) like as: INF RuleOverride =3D UI MdeModulePkg/Application/UiApp/UiApp.inf 3. Trim generate incorrect Offset.raw when some vfr not generate .lst file in Debug directory, Trim get the VFR name with the .c files replacement. 4. fix some depex file not generate issue Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/GenFds/EfiSection.py | 12 ++++++++++-- BaseTools/Source/Python/GenFds/FfsInfStatement.py | 4 +++- BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 6 ++++-- BaseTools/Source/Python/GenFds/GuidSection.py | 2 ++ BaseTools/Source/Python/Trim/Trim.py | 2 +- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Sourc= e/Python/GenFds/EfiSection.py index 5029ec7a18..e6323c7879 100644 --- a/BaseTools/Source/Python/GenFds/EfiSection.py +++ b/BaseTools/Source/Python/GenFds/EfiSection.py @@ -62,10 +62,11 @@ class EfiSection (EfiSectionClassObject): InfFileName =3D FfsInf.InfFileName SectionType =3D FfsInf.__ExtendMacro__(self.SectionType) Filename =3D FfsInf.__ExtendMacro__(self.FileName) BuildNum =3D FfsInf.__ExtendMacro__(self.BuildNum) StringData =3D FfsInf.__ExtendMacro__(self.StringData) + ModuleNameStr =3D FfsInf.__ExtendMacro__('$(MODULE_NAME)') NoStrip =3D True if FfsInf.ModuleType in ('SEC', 'PEI_CORE', 'PEIM') and Sectio= nType in ('TE', 'PE32'): if FfsInf.KeepReloc !=3D None: NoStrip =3D FfsInf.KeepReloc elif FfsInf.KeepRelocFromRule !=3D None: @@ -89,12 +90,13 @@ class EfiSection (EfiSectionClassObject): =20 if not self.Optional: FileList.append(Filename) elif os.path.exists(Filename): FileList.append(Filename) - elif '.depex' in FfsInf.FinalTargetSuffixMap or FfsInf.Depex: - if IsMakefile: + elif IsMakefile: + SuffixMap =3D FfsInf.GetFinalTargetSuffixMap() + if '.depex' in SuffixMap: FileList.append(Filename) else: FileList, IsSect =3D Section.Section.GetFileList(FfsInf, self.= FileType, self.FileExtension, Dict, IsMakefile=3DIsMakefile) if IsSect : return FileList, self.Alignment @@ -177,10 +179,12 @@ class EfiSection (EfiSectionClassObject): StringData =3D FfsInf.Ui InfOverrideUiString =3D True =20 if InfOverrideUiString: Num =3D SecNum + if IsMakefile and StringData =3D=3D ModuleNameStr: + StringData =3D "$(MODULE_NAME)" OutputFile =3D os.path.join( OutputPath, ModuleName + 'SEC= ' + str(Num) + Ffs.SectionSuffix.get(SectionType)) GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_= SECTION_USER_INTERFACE', Ui=3DStringData, IsMa= kefile=3DIsMakefile) OutputFileList.append(OutputFile) =20 @@ -190,10 +194,12 @@ class EfiSection (EfiSectionClassObject): Num =3D '%s.%d' %(SecNum , Index) OutputFile =3D os.path.join(OutputPath, ModuleName + '= SEC' + Num + Ffs.SectionSuffix.get(SectionType)) f =3D open(File, 'r') UiString =3D f.read() f.close() + if IsMakefile and UiString =3D=3D ModuleNameStr: + UiString =3D "$(MODULE_NAME)" GenFdsGlobalVariable.GenerateSection(OutputFile, [], '= EFI_SECTION_USER_INTERFACE', Ui=3DUiString, IsM= akefile=3DIsMakefile) OutputFileList.append(OutputFile) else: if StringData !=3D None and len(StringData) > 0: @@ -206,10 +212,12 @@ class EfiSection (EfiSectionClassObject): return '', None else: EdkLogger.error("GenFds", GENFDS_ERROR, "File: %s = miss UI Section value" %InfFileName) =20 Num =3D SecNum + if IsMakefile and StringData =3D=3D ModuleNameStr: + StringData =3D "$(MODULE_NAME)" OutputFile =3D os.path.join( OutputPath, ModuleName + 'SEC= ' + str(Num) + Ffs.SectionSuffix.get(SectionType)) GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_= SECTION_USER_INTERFACE', Ui=3DStringData, IsMa= kefile=3DIsMakefile) OutputFileList.append(OutputFile) =20 diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/= Source/Python/GenFds/FfsInfStatement.py index a348233911..84450ef3fe 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -500,13 +500,15 @@ class FfsInfStatement(FfsInfStatementClassObject): EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework= SMM module doesn't support SMM or SMM_CORE FV file type", File=3Dself.InfF= ileName) # # For the rule only has simpleFile # MakefilePath =3D None + if self.IsBinaryModule: + IsMakefile =3D False if IsMakefile: MakefilePath =3D self.InfFileName, Arch - if isinstance (Rule, RuleSimpleFile.RuleSimpleFile) : + if isinstance (Rule, RuleSimpleFile.RuleSimpleFile): SectionOutputList =3D self.__GenSimpleFileSection__(Rule, IsMa= kefile=3DIsMakefile) FfsOutput =3D self.__GenSimpleFileFfs__(Rule, SectionOutputLis= t, MakefilePath=3DMakefilePath) return FfsOutput # # For Rule has ComplexFile diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseT= ools/Source/Python/GenFds/GenFdsGlobalVariable.py index 97e20753ae..6437e5fa30 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -462,13 +462,15 @@ class GenFdsGlobalVariable: =20 CommandFile =3D Output + '.txt' if Ui not in [None, '']: #Cmd +=3D ["-n", '"' + Ui + '"'] if IsMakefile: - Cmd +=3D ["-n", "$(MODULE_NAME)"] + if Ui =3D=3D "$(MODULE_NAME)": + Cmd +=3D ['-n', Ui] + else: + Cmd +=3D ["-n", '"' + Ui + '"'] Cmd +=3D ["-o", Output] - #SaveFileOnChange(CommandFile, ' '.join(Cmd), False) if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCm= dList: GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).s= trip()) else: SectionData =3D array.array('B', [0, 0, 0, 0]) SectionData.fromstring(Ui.encode("utf_16_le")) diff --git a/BaseTools/Source/Python/GenFds/GuidSection.py b/BaseTools/Sour= ce/Python/GenFds/GuidSection.py index ea737bb9a7..b8612be05f 100644 --- a/BaseTools/Source/Python/GenFds/GuidSection.py +++ b/BaseTools/Source/Python/GenFds/GuidSection.py @@ -270,9 +270,11 @@ class GuidSection(GuidSectionClassObject) : if 'PROCESSING_REQUIRED' in Attribute: # reset guided section alignment to none for the processed= required guided data self.Alignment =3D None self.IncludeFvSection =3D False self.ProcessRequired =3D "TRUE" + if IsMakefile and self.Alignment.strip() =3D=3D '0': + self.Alignment =3D '1' return OutputFileList, self.Alignment =20 =20 =20 diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python= /Trim/Trim.py index d1e40b025c..b98c8ff779 100644 --- a/BaseTools/Source/Python/Trim/Trim.py +++ b/BaseTools/Source/Python/Trim/Trim.py @@ -435,11 +435,11 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFil= e): VfrNameList =3D [] if os.path.isdir(DebugDir): for CurrentDir, Dirs, Files in os.walk(DebugDir): for FileName in Files: Name, Ext =3D os.path.splitext(FileName) - if Ext =3D=3D '.lst': + if Ext =3D=3D '.c' and Name !=3D 'AutoGen': VfrNameList.append (Name + 'Bin') =20 VfrNameList.append (ModuleName + 'Strings') =20 EfiFileName =3D os.path.join(DebugDir, ModuleName + '.efi') --=20 2.12.2.windows.2