]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Enhance error handling for unsupported toolchain Flags/Path
authorYonghong Zhu <yonghong.zhu@intel.com>
Wed, 7 Feb 2018 01:17:08 +0000 (09:17 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Thu, 8 Feb 2018 08:23:37 +0000 (16:23 +0800)
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>
BaseTools/Source/Python/AutoGen/GenMake.py

index 9df5d8e2d707d946e2b983045ecb62c7d8c31be2..afe6f2f99c47bee78e8bc76e426c4d5b98f551cd 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Create makefile for MS nmake and GNU make\r
 #\r
-# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -798,9 +798,13 @@ cleanlib:
                                     Tool = Flag\r
                                     break\r
                         if Tool:\r
+                            if 'PATH' not in self._AutoGenObject._BuildOption[Tool]:\r
+                                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))\r
                             SingleCommandLength += len(self._AutoGenObject._BuildOption[Tool]['PATH'])\r
                             for item in SingleCommandList[1:]:\r
                                 if FlagDict[Tool]['Macro'] in item:\r
+                                    if 'FLAGS' not in self._AutoGenObject._BuildOption[Tool]:\r
+                                        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))\r
                                     Str = self._AutoGenObject._BuildOption[Tool]['FLAGS']\r
                                     for Option in self._AutoGenObject.BuildOption.keys():\r
                                         for Attr in self._AutoGenObject.BuildOption[Option]:\r