summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2018-02-07 09:17:08 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-02-08 16:23:37 +0800
commit70d0a7549ef4a5dbdd15c0f78bd2f8ede093f8f4 (patch)
treeb3b2ace0de4fdaba5b25c3a8d87b9ace276e2a7c
parent28fd7b090d1b416f1e94e52abd08bf16fd404649 (diff)
downloadedk2-70d0a7549ef4a5dbdd15c0f78bd2f8ede093f8f4.tar.gz
edk2-70d0a7549ef4a5dbdd15c0f78bd2f8ede093f8f4.tar.bz2
edk2-70d0a7549ef4a5dbdd15c0f78bd2f8ede093f8f4.zip
BaseTools: Enhance error handling for unsupported toolchain Flags/Path
Case1: Cover the Tool PATH is not exist, eg: build MdeModule under GCC5 toolchain and IPF arch. Case2: Cover the Tool FLAGS is not exist, eg: build OvmfPkg under CLANG35 toolchain and X64 arch. fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=595 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
-rw-r--r--BaseTools/Source/Python/AutoGen/GenMake.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 9df5d8e2d7..afe6f2f99c 100644
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -1,7 +1,7 @@
## @file
# Create makefile for MS nmake and GNU make
#
-# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -798,9 +798,13 @@ cleanlib:
Tool = Flag
break
if Tool:
+ if 'PATH' not in self._AutoGenObject._BuildOption[Tool]:
+ EdkLogger.error("build", AUTOGEN_ERROR, "%s_PATH doesn't exist in %s ToolChain and %s Arch." %(Tool, self._AutoGenObject.ToolChain, self._AutoGenObject.Arch), ExtraData="[%s]" % str(self._AutoGenObject))
SingleCommandLength += len(self._AutoGenObject._BuildOption[Tool]['PATH'])
for item in SingleCommandList[1:]:
if FlagDict[Tool]['Macro'] in item:
+ if 'FLAGS' not in self._AutoGenObject._BuildOption[Tool]:
+ EdkLogger.error("build", AUTOGEN_ERROR, "%s_FLAGS doesn't exist in %s ToolChain and %s Arch." %(Tool, self._AutoGenObject.ToolChain, self._AutoGenObject.Arch), ExtraData="[%s]" % str(self._AutoGenObject))
Str = self._AutoGenObject._BuildOption[Tool]['FLAGS']
for Option in self._AutoGenObject.BuildOption.keys():
for Attr in self._AutoGenObject.BuildOption[Option]: