From: Yonghong Zhu Date: Wed, 7 Feb 2018 01:17:08 +0000 (+0800) Subject: BaseTools: Enhance error handling for unsupported toolchain Flags/Path X-Git-Tag: edk2-stable201903~2428 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=70d0a7549ef4a5dbdd15c0f78bd2f8ede093f8f4 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 Reviewed-by: Liming Gao --- 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.
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
# 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]: