diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-03-16 11:06:44 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-03-22 17:16:49 +0800 |
commit | 725cdb8fbfb034cd73574ed9c356b0dca14ff843 (patch) | |
tree | 499ecaa00449ca43e94a549f0802db955212966e /BaseTools/Source/Python/AutoGen/AutoGen.py | |
parent | 3362c5f17a3af3151b30f895c2c13fc0280a7ad3 (diff) | |
download | edk2-725cdb8fbfb034cd73574ed9c356b0dca14ff843.tar.gz edk2-725cdb8fbfb034cd73574ed9c356b0dca14ff843.tar.bz2 edk2-725cdb8fbfb034cd73574ed9c356b0dca14ff843.zip |
BaseTools: Fix nmake failure due to command-line length limitation
NMAKE is limited to command-line length of 4096 characters. Due to the
large number of /I directives specified on command line (one per include
directory), the path length of WORKSPACE is multiplied by the number of
/I directives and can exceed the limit.
This patch:
1. Add new build option -l, --cmd-len to set the maximum command line
length, default value is 4096.
2. Generate the response file only if the command line length exceed its
maximum characters (default is 4096) when build the module. Cover
PP_FLAGS, CC_FLAGS, VFRPP_FLAGS, APP_FLAGS, ASLPP_FLAGS, ASLCC_FLAGS and
ASM_FLAGS.
3. The content of the response file is combine from the FLAGS option and
INC option.
4. When build failure, it would print out the response file's file
location and its content.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index c7aa84fb34..4934c578fa 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -2378,6 +2378,7 @@ class ModuleAutoGen(AutoGen): self._MakeFileDir = None
self._IncludePathList = None
+ self._IncludePathLength = 0
self._AutoGenFileList = None
self._UnicodeFileList = None
self._SourceFileList = None
@@ -3224,6 +3225,13 @@ class ModuleAutoGen(AutoGen): self._IncludePathList.append(str(Inc))
return self._IncludePathList
+ def _GetIncludePathLength(self):
+ self._IncludePathLength = 0
+ if self._IncludePathList:
+ for inc in self._IncludePathList:
+ self._IncludePathLength += len(' ' + inc)
+ return self._IncludePathLength
+
## Get HII EX PCDs which maybe used by VFR
#
# efivarstore used by VFR may relate with HII EX PCDs
@@ -3816,6 +3824,7 @@ class ModuleAutoGen(AutoGen): CustomMakefile = property(_GetCustomMakefile)
IncludePathList = property(_GetIncludePathList)
+ IncludePathLength = property(_GetIncludePathLength)
AutoGenFileList = property(_GetAutoGenFileList)
UnicodeFileList = property(_GetUnicodeFileList)
SourceFileList = property(_GetSourceFileList)
|