public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 1/1 V2] BaseTools: Fix a bug of genffs command generation
@ 2019-09-30  3:14 Bob Feng
  0 siblings, 0 replies; only message in thread
From: Bob Feng @ 2019-09-30  3:14 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Bob Feng

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 <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-30  3:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-30  3:14 [Patch 1/1 V2] BaseTools: Fix a bug of genffs command generation Bob Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox