From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: bob.c.feng@intel.com) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by groups.io with SMTP; Sun, 29 Sep 2019 20:14:04 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Sep 2019 20:14:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,565,1559545200"; d="scan'208";a="181228159" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga007.jf.intel.com with ESMTP; 29 Sep 2019 20:14:02 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Liming Gao , Bob Feng Subject: [Patch 1/1 V2] BaseTools: Fix a bug of genffs command generation Date: Mon, 30 Sep 2019 11:14:00 +0800 Message-Id: <20190930031400.26140-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2221 The command used by multiple thread genffs feature in makefile for testing if file exist is generated based on the toolchain family. It should be based on the make program name. Cc: Liming Gao Signed-off-by: Bob Feng --- BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 4 +++- BaseTools/Source/Python/build/build.py | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index 4d8b2bdee299..1b4c75034333 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -68,10 +68,11 @@ class GenFdsGlobalVariable: FfsCmdDict = {} SecCmdList = [] CopyList = [] ModuleFile = '' EnableGenfdsMultiThread = True + Make = "" # # The list whose element are flags to indicate if large FFS or SECTION files exist in FV. # At the beginning of each generation of FV, false flag is appended to the list, # after the call to GenerateSection returns, check the size of the output file, @@ -320,10 +321,11 @@ class GenFdsGlobalVariable: GenFdsGlobalVariable.ModuleFile = WorkSpace.ModuleFile GenFdsGlobalVariable.FdfParser = FdfParser GenFdsGlobalVariable.WorkSpace = WorkSpace.Db GenFdsGlobalVariable.ArchList = ArchList GenFdsGlobalVariable.ToolChainTag = GlobalData.gGlobalDefines["TOOL_CHAIN_TAG"] + GenFdsGlobalVariable.Make = GlobalData.gGlobalDefines['Make'] GenFdsGlobalVariable.TargetName = GlobalData.gGlobalDefines["TARGET"] GenFdsGlobalVariable.ActivePlatform = GlobalData.gActivePlatform GenFdsGlobalVariable.ConfDir = GlobalData.gConfDirectory GenFdsGlobalVariable.EnableGenfdsMultiThread = GlobalData.gEnableGenfdsMultiThread for Arch in ArchList: @@ -484,11 +486,11 @@ class GenFdsGlobalVariable: Cmd += ("-o", Output) Cmd += Input SaveFileOnChange(CommandFile, ' '.join(Cmd), False) if IsMakefile: - if GlobalData.gGlobalDefines.get("FAMILY") == "MSFT": + if "nmake" in GenFdsGlobalVariable.Make: Cmd = ['if', 'exist', Input[0]] + Cmd else: Cmd = ['-test', '-e', Input[0], "&&"] + Cmd if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdList: GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).strip()) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index bcd832c525f1..1c02d144d19d 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1726,11 +1726,11 @@ class Build(): ) self.Fdf = Wa.FdfFile self.LoadFixAddress = Wa.Platform.LoadFixAddress self.BuildReport.AddPlatformReport(Wa) self.Progress.Stop("done!") - + GlobalData.gGlobalDefines['Make'] = os.path.basename(Wa.ToolDefinition["MAKE"]["PATH"]) # Add ffs build to makefile CmdListDict = {} if GlobalData.gEnableGenfdsMultiThread and self.Fdf: CmdListDict = self._GenFfsCmd(Wa.ArchList) @@ -1827,10 +1827,11 @@ class Build(): self.Progress, self.ModuleFile ) self.Fdf = Wa.FdfFile self.LoadFixAddress = Wa.Platform.LoadFixAddress + GlobalData.gGlobalDefines['Make'] = os.path.basename(Wa.ToolDefinition["MAKE"]["PATH"]) Wa.CreateMakeFile(False) # Add ffs build to makefile CmdListDict = None if GlobalData.gEnableGenfdsMultiThread and self.Fdf: CmdListDict = self._GenFfsCmd(Wa.ArchList) @@ -2096,11 +2097,11 @@ class Build(): ) self.Fdf = Wa.FdfFile self.LoadFixAddress = Wa.Platform.LoadFixAddress self.BuildReport.AddPlatformReport(Wa) Wa.CreateMakeFile(False) - + GlobalData.gGlobalDefines['Make'] = os.path.basename(Wa.ToolDefinition["MAKE"]["PATH"]) # Add ffs build to makefile CmdListDict = {} if GlobalData.gEnableGenfdsMultiThread and self.Fdf: CmdListDict = self._GenFfsCmd(Wa.ArchList) @@ -2214,11 +2215,10 @@ class Build(): self.BuildModules = self.SetupMakeSetting(Wa) else: Wa, self.BuildModules = self.PerformAutoGen(BuildTarget,ToolChain) Pa = Wa.AutoGenObjectList[0] GlobalData.gAutoGenPhase = False - if GlobalData.gBinCacheSource: EdkLogger.quiet("Total cache hit driver num: %s, cache miss driver num: %s" % (len(set(self.HashSkipModules)), len(set(self.BuildModules)))) CacheHitMa = set() CacheNotHitMa = set() for IR in GlobalData.gCacheIR.keys(): -- 2.20.1.windows.1