summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-07-20 13:58:03 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-07-27 09:48:58 +0800
commit2502b73557ae2a9014b4367e85740e209d14c06e (patch)
tree0bd65a834c59f6a0f5442f967b70da5a80c01247 /BaseTools
parent4c53eb72d539f5ca61f949235014f7e43f0e6354 (diff)
BaseTools: report error if source module INF is only list in FDF file
If source module INF is not listed in DSC, it will not be built. And it is listed in FDF, GenFds will fail to find its build output. To reminder user this issue early, build tool should report failure to user in early phase. Cc: Liming Gao <liming.gao@intel.com> 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')
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py28
-rw-r--r--BaseTools/Source/Python/GenFds/FdfParser.py15
2 files changed, 43 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 8da441f6b9..9a9501415f 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -329,6 +329,34 @@ class WorkspaceAutoGen(AutoGen):
if fvname.upper() not in self.FdfProfile.FvDict:
EdkLogger.error("build", OPTION_VALUE_INVALID,
"No such an FV in FDF file: %s" % fvname)
+
+ for key in self.FdfProfile.InfDict:
+ if key == 'ArchTBD':
+ Platform_cache = {}
+ for Arch in self.ArchList:
+ Platform_cache[Arch] = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
+ for Inf in self.FdfProfile.InfDict[key]:
+ ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch)
+ for Arch in self.ArchList:
+ if ModuleFile in Platform_cache[Arch].Modules:
+ break
+ else:
+ ModuleData = self.BuildDatabase[ModuleFile, Arch, Target, Toolchain]
+ if not ModuleData.IsBinaryModule:
+ EdkLogger.error('build', PARSER_ERROR, "Module %s NOT found in DSC file; Is it really a binary module?" % ModuleFile)
+
+ else:
+ for Arch in self.ArchList:
+ if Arch == key:
+ Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
+ for Inf in self.FdfProfile.InfDict[key]:
+ ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch)
+ if ModuleFile in Platform.Modules:
+ continue
+ ModuleData = self.BuildDatabase[ModuleFile, Arch, Target, Toolchain]
+ if not ModuleData.IsBinaryModule:
+ EdkLogger.error('build', PARSER_ERROR, "Module %s NOT found in DSC file; Is it really a binary module?" % ModuleFile)
+
else:
PcdSet = {}
ModuleList = []
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index 56303e1694..8709cfc091 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -231,6 +231,7 @@ class FileProfile :
self.PcdDict = {}
self.InfList = []
+ self.InfDict = {'ArchTBD':[]}
# ECC will use this Dict and List information
self.PcdFileLineDict = {}
self.InfFileLineList = []
@@ -2472,6 +2473,13 @@ class FdfParser:
self.Profile.InfList.append(ffsInf.InfFileName)
FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
self.Profile.InfFileLineList.append(FileLineTuple)
+ if ffsInf.UseArch:
+ if ffsInf.UseArch not in self.Profile.InfDict:
+ self.Profile.InfDict[ffsInf.UseArch] = [ffsInf.InfFileName]
+ else:
+ self.Profile.InfDict[ffsInf.UseArch].append(ffsInf.InfFileName)
+ else:
+ self.Profile.InfDict['ArchTBD'].append(ffsInf.InfFileName)
if self.__IsToken('|'):
if self.__IsKeyword('RELOCS_STRIPPED'):
@@ -4351,6 +4359,13 @@ class FdfParser:
self.Profile.InfList.append(ffsInf.InfFileName)
FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
self.Profile.InfFileLineList.append(FileLineTuple)
+ if ffsInf.UseArch:
+ if ffsInf.UseArch not in self.Profile.InfDict:
+ self.Profile.InfDict[ffsInf.UseArch] = [ffsInf.InfFileName]
+ else:
+ self.Profile.InfDict[ffsInf.UseArch].append(ffsInf.InfFileName)
+ else:
+ self.Profile.InfDict['ArchTBD'].append(ffsInf.InfFileName)
self.__GetOptRomOverrides (ffsInf)