From 725cdb8fbfb034cd73574ed9c356b0dca14ff843 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Wed, 16 Mar 2016 11:06:44 +0800 Subject: 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 Reviewed-by: Liming Gao --- BaseTools/Source/Python/Common/GlobalData.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/Common') diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index 4234bf5f95..8f544bd1b2 100644 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -34,7 +34,7 @@ gActivePlatform = None gCommandLineDefines = {} gEdkGlobal = {} gOverrideDir = {} - +gCommandMaxLength = 4096 # for debug trace purpose when problem occurs gProcessingFile = '' gBuildingModule = '' -- cgit v1.2.3