GenFds output message clarification for build ARCH.
authorjlin16 <jlin16@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 12 Aug 2008 04:23:35 +0000 (04:23 +0000)
committerjlin16 <jlin16@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 12 Aug 2008 04:23:35 +0000 (04:23 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1299 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/GenFds/FfsInfStatement.py
Source/Python/GenFds/GenFds.py

index 74e1cb1..968e8ba 100644 (file)
@@ -227,12 +227,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
     #   @retval list        Arch list\r
     #\r
     def __GetPlatformArchList__(self):\r
-        TargetArchList = GenFdsGlobalVariable.ArchList\r
-        if len(TargetArchList) == 0:\r
-            TargetArchList = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList\r
-        else:\r
-            TargetArchList = set(GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList) & set(TargetArchList)\r
-\r
+        \r
         InfFileKey = os.path.normpath(self.InfFileName)\r
         DscArchList = []\r
         PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'IA32']\r
@@ -250,11 +245,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
             if InfFileKey in (PlatformDataBase.Modules):\r
                 DscArchList.append ('IPF')\r
 \r
-        CurArchList = TargetArchList\r
-        if DscArchList != []:\r
-            CurArchList = set (TargetArchList) & set (DscArchList)\r
-        GenFdsGlobalVariable.VerboseLogger ("Valid target architecture(s) is : " + " ".join(CurArchList))\r
-        return list(CurArchList)\r
+        return DscArchList\r
 \r
     ## GetCurrentArch() method\r
     #\r
@@ -264,7 +255,16 @@ class FfsInfStatement(FfsInfStatementClassObject):
     #   @retval list        Arch list\r
     #\r
     def GetCurrentArch(self) :\r
-        CurArchList = self.__GetPlatformArchList__()\r
+        \r
+        TargetArchList = GenFdsGlobalVariable.ArchList\r
+            \r
+        PlatformArchList = self.__GetPlatformArchList__()\r
+        \r
+        CurArchList = TargetArchList\r
+        if PlatformArchList != []:\r
+            CurArchList = list(set (TargetArchList) & set (PlatformArchList))\r
+        GenFdsGlobalVariable.VerboseLogger ("Valid target architecture(s) is : " + " ".join(CurArchList))\r
+        \r
         ArchList = []\r
         if self.KeyStringList != []:\r
             for Key in self.KeyStringList:\r
@@ -281,9 +281,9 @@ class FfsInfStatement(FfsInfStatementClassObject):
             Arch = ArchList[0]\r
             return Arch\r
         elif len(ArchList) > 1:\r
-            EdkLogger.error("GenFds", GENFDS_ERROR, "Not able to determine ARCH for Module %s !" % self.InfFileName)\r
+            EdkLogger.error("GenFds", GENFDS_ERROR, "Module built under multiple ARCHs %s. Not able to determine which output to put into flash for Module %s !" % (str(ArchList), self.InfFileName))\r
         else:\r
-            EdkLogger.error("GenFds", GENFDS_ERROR, "Don't find legal ARCH in Module %s !" % self.InfFileName)\r
+            EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s appears under ARCH %s in platform %s, but current target ARCH is %s, so NO build output could be put into flash." % (self.InfFileName, str(PlatformArchList), GenFdsGlobalVariable.ActivePlatform, str(TargetArchList)))\r
 \r
     ## __GetEFIOutPutPath__() method\r
     #\r
index 1d51ea0..01baa9e 100644 (file)
@@ -132,11 +132,6 @@ def main():
 
         GenFdsGlobalVariable.ActivePlatform = NormPath(ActivePlatform)
 
-        if (Options.archList) :
-            ArchList = Options.archList.split(',')
-        else:
-            EdkLogger.error("GenFds", BuildToolError.OPTION_MISSING, "Missing build ARCH")
-
         BuildConfigurationFile = os.path.normpath(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, "Conf/target.txt"))
         if os.path.isfile(BuildConfigurationFile) == True:
             TargetTxtClassObject.TargetTxtClassObject(BuildConfigurationFile)
@@ -158,6 +153,16 @@ def main():
         BuildWorkSpace = WorkspaceDatabase(':memory:', GlobalData.gGlobalDefines)
         BuildWorkSpace.InitDatabase()
 
+        if (Options.archList) :
+            ArchList = Options.archList.split(',')
+        else:
+#            EdkLogger.error("GenFds", BuildToolError.OPTION_MISSING, "Missing build ARCH")
+            ArchList = BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList
+
+        TargetArchList = set(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList) & set(ArchList)
+        if len(TargetArchList) == 0:
+            EdkLogger.error("GenFds", GENFDS_ERROR, "Target ARCH %s not in platform supported ARCH %s" % (str(ArchList), str(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList)))
+        
         for Arch in ArchList:
             GenFdsGlobalVariable.OutputDirFromDscDict[Arch] = NormPath(BuildWorkSpace.BuildObject[ActivePlatform, Arch].OutputDirectory)