diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index 47dae82e1a..4f85a93055 100755 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -1580,8 +1580,8 @@ class TopLevelMakefile(BuildFile): if GlobalData.gCaseInsensitive: ExtraOption += " -c" - if GlobalData.gEnableGenfdsMultiThread: - ExtraOption += " --genfds-multi-thread" + if not GlobalData.gEnableGenfdsMultiThread: + ExtraOption += " --no-genfds-multi-thread" if GlobalData.gIgnoreSource: ExtraOption += " --ignore-sources" diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py index f9d2c21616..9d8040905e 100644 --- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py @@ -833,8 +833,7 @@ class WorkspaceAutoGen(AutoGen): elif LogLevel == EdkLogger.QUIET: FdsCommandDict["quiet"] = True - if GlobalData.gEnableGenfdsMultiThread: - FdsCommandDict["GenfdsMultiThread"] = True + FdsCommandDict["GenfdsMultiThread"] = GlobalData.gEnableGenfdsMultiThread if GlobalData.gIgnoreSource: FdsCommandDict["IgnoreSources"] = True diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index 61327ad8f1..8eb72aa1d6 100755 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -106,7 +106,7 @@ gBinCacheSource = None gPlatformHash = None gPackageHash = {} gModuleHash = {} -gEnableGenfdsMultiThread = False +gEnableGenfdsMultiThread = True gSikpAutoGenCache = set() # Dictionary for tracking Module build status as success or failure diff --git a/BaseTools/Source/Python/Common/buildoptions.py b/BaseTools/Source/Python/Common/buildoptions.py index 7161aa66f2..a717c58d8c 100644 --- a/BaseTools/Source/Python/Common/buildoptions.py +++ b/BaseTools/Source/Python/Common/buildoptions.py @@ -84,7 +84,8 @@ def MyOptionParser(): Parser.add_option("--hash", action="store_true", dest="UseHashCache", default=False, help="Enable hash-based caching during build process.") Parser.add_option("--binary-destination", action="store", type="string", dest="BinCacheDest", help="Generate a cache of binary files in the specified directory.") Parser.add_option("--binary-source", action="store", type="string", dest="BinCacheSource", help="Consume a cache of binary files from the specified directory.") - Parser.add_option("--genfds-multi-thread", action="store_true", dest="GenfdsMultiThread", default=False, help="Enable GenFds multi thread to generate ffs file.") + Parser.add_option("--genfds-multi-thread", action="store_true", dest="GenfdsMultiThread", default=True, help="Enable GenFds multi thread to generate ffs file.") + Parser.add_option("--no-genfds-multi-thread", action="store_true", dest="NoGenfdsMultiThread", default=False, help="Disable GenFds multi thread to generate ffs file.") Parser.add_option("--disable-include-path-check", action="store_true", dest="DisableIncludePathCheck", default=False, help="Disable the include path check for outside of package.") (Opt, Args) = Parser.parse_args() return (Opt, Args) diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py index 51943411ad..d8bc28e4d0 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -93,7 +93,7 @@ def resetFdsGlobalVariable(): GenFdsGlobalVariable.SecCmdList = [] GenFdsGlobalVariable.CopyList = [] GenFdsGlobalVariable.ModuleFile = '' - GenFdsGlobalVariable.EnableGenfdsMultiThread = False + GenFdsGlobalVariable.EnableGenfdsMultiThread = True GenFdsGlobalVariable.LargeFileInFvFlags = [] GenFdsGlobalVariable.EFI_FIRMWARE_FILE_SYSTEM3_GUID = '5473C07A-3DCB-4dca-BD6F-1E9689E7349A' @@ -140,6 +140,8 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None): GenFdsGlobalVariable.VerboseLogger("Using Workspace:" + Workspace) if FdsCommandDict.get("GenfdsMultiThread"): GenFdsGlobalVariable.EnableGenfdsMultiThread = True + else: + GenFdsGlobalVariable.EnableGenfdsMultiThread = False os.chdir(GenFdsGlobalVariable.WorkSpaceDir) # set multiple workspace @@ -402,7 +404,7 @@ def OptionsToCommandDict(Options): FdsCommandDict["quiet"] = Options.quiet FdsCommandDict["debug"] = Options.debug FdsCommandDict["Workspace"] = Options.Workspace - FdsCommandDict["GenfdsMultiThread"] = Options.GenfdsMultiThread + FdsCommandDict["GenfdsMultiThread"] = not Options.NoGenfdsMultiThread FdsCommandDict["fdf_file"] = [PathClass(Options.filename)] if Options.filename else [] FdsCommandDict["build_target"] = Options.BuildTarget FdsCommandDict["toolchain_tag"] = Options.ToolChain @@ -459,7 +461,8 @@ def myOptionParser(): Parser.add_option("--conf", action="store", type="string", dest="ConfDirectory", help="Specify the customized Conf directory.") Parser.add_option("--ignore-sources", action="store_true", dest="IgnoreSources", default=False, help="Focus to a binary build and ignore all source files") Parser.add_option("--pcd", action="append", dest="OptionPcd", help="Set PCD value by command line. Format: \"PcdName=Value\" ") - Parser.add_option("--genfds-multi-thread", action="store_true", dest="GenfdsMultiThread", default=False, help="Enable GenFds multi thread to generate ffs file.") + Parser.add_option("--genfds-multi-thread", action="store_true", dest="GenfdsMultiThread", default=True, help="Enable GenFds multi thread to generate ffs file.") + Parser.add_option("--no-genfds-multi-thread", action="store_true", dest="NoGenfdsMultiThread", default=False, help="Disable GenFds multi thread to generate ffs file.") Options, _ = Parser.parse_args() return Options diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index 0f691ae524..3dc73c8f61 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -69,7 +69,7 @@ class GenFdsGlobalVariable: SecCmdList = [] CopyList = [] ModuleFile = '' - EnableGenfdsMultiThread = False + EnableGenfdsMultiThread = True # # The list whose element are flags to indicate if large FFS or SECTION files exist in FV. diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index d314c015aa..e81d3d6486 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -731,7 +731,7 @@ class Build(): GlobalData.gUseHashCache = BuildOptions.UseHashCache GlobalData.gBinCacheDest = BuildOptions.BinCacheDest GlobalData.gBinCacheSource = BuildOptions.BinCacheSource - GlobalData.gEnableGenfdsMultiThread = BuildOptions.GenfdsMultiThread + GlobalData.gEnableGenfdsMultiThread = not BuildOptions.NoGenfdsMultiThread GlobalData.gDisableIncludePathCheck = BuildOptions.DisableIncludePathCheck if GlobalData.gBinCacheDest and not GlobalData.gUseHashCache: