]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix build failure when multiple build targets given
authorBob Feng <bob.c.feng@intel.com>
Wed, 11 Dec 2019 11:22:21 +0000 (19:22 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 18 Dec 2019 01:01:57 +0000 (01:01 +0000)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2371

This patch is to fix a regression issue that build fails
if multiple build targets given.

Two changes cause this regression issue.
One is AutoGen object __hash__ function only
hash file path and arch, missing ToolChain and build target.

The other is changing the multiple-thread-genfds function as default
build behavior. To generate the genffs command to Makefile, there
is a global data set is used, GenFdsGlobalVariable, which cause build
tool use the data of first build-target build in
the second build-target build.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
BaseTools/Source/Python/build/build.py

index 74662d1b52bc09e217744521f5f331bccc3e7d89..aad591de65f086043d55aeea5661f59c53792e7c 100755 (executable)
@@ -270,7 +270,7 @@ class ModuleAutoGen(AutoGen):
     #\r
     @cached_class_function\r
     def __hash__(self):\r
-        return hash((self.MetaFile, self.Arch))\r
+        return hash((self.MetaFile, self.Arch, self.ToolChain,self.BuildTarget))\r
     def __repr__(self):\r
         return "%s [%s]" % (self.MetaFile, self.Arch)\r
 \r
index 4c3cdf82d57fe76eefa5f68fbcb55ab9106eb52b..7bd24dad42f8142694659861e03033fa082f2e32 100644 (file)
@@ -148,7 +148,7 @@ class PlatformAutoGen(AutoGen):
     #\r
     @cached_class_function\r
     def __hash__(self):\r
-        return hash((self.MetaFile, self.Arch))\r
+        return hash((self.MetaFile, self.Arch,self.ToolChain,self.BuildTarget))\r
     @cached_class_function\r
     def __repr__(self):\r
         return "%s [%s]" % (self.MetaFile, self.Arch)\r
index 8a8e32e496f879b7ede7909894d68959c180a2e5..77b46341b5adb2a535a2538e15d40ef9ed6b5922 100755 (executable)
@@ -58,6 +58,7 @@ from AutoGen.DataPipe import MemoryDataPipe
 from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo, PlatformInfo\r
 from GenFds.FdfParser import FdfParser\r
 from AutoGen.IncludesAutoGen import IncludesAutoGen\r
+from GenFds.GenFds import resetFdsGlobalVariable\r
 \r
 ## standard targets of build command\r
 gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']\r
@@ -2207,6 +2208,7 @@ class Build():
             GlobalData.gGlobalDefines['TARGET'] = BuildTarget\r
             index = 0\r
             for ToolChain in self.ToolChainList:\r
+                resetFdsGlobalVariable()\r
                 GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain\r
                 GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = ToolChain\r
                 GlobalData.gGlobalDefines['FAMILY'] = self.ToolChainFamily[index]\r