]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/Build: Consider only build-specified architectures
authorThomas Palmer <thomas.palmer@hpe.com>
Sat, 16 Apr 2016 01:45:02 +0000 (09:45 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 19 Apr 2016 02:30:54 +0000 (10:30 +0800)
When building for any specific architecture, the build script today
is loading DSC sections for other architectures not in the build.
The build process should disregard DSC sections that are not
relevant to the build.

This fixes scenario whereby a build occurs in a source tree that was
been cleaned of non-essential directories.  For instance, X64 builds
do not require the ArmPkg directory to build a firmware image.  This
condition (build break when ArmPkg is absent) occurs when included
DSCs have sections for multiple architectures.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/GenFds/FfsInfStatement.py
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py

index 864e5be7d9e078977e80fc55d2aec1bb926deebc..3c59f14aa8cf7b9702503678cf3afb481c93d66e 100644 (file)
@@ -2,7 +2,7 @@
 # process FFS generation from INF statement\r
 #\r
 #  Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
-#  Copyright (c) 2014 Hewlett-Packard Development Company, L.P.<BR>\r
+#  Copyright (c) 2014-2016 Hewlett-Packard Development Company, L.P.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -555,35 +555,11 @@ class FfsInfStatement(FfsInfStatementClassObject):
 \r
         InfFileKey = os.path.normpath(mws.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName))\r
         DscArchList = []\r
-        PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'IA32', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
-        if  PlatformDataBase != None:\r
-            if InfFileKey in PlatformDataBase.Modules:\r
-                DscArchList.append ('IA32')\r
-\r
-        PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'X64', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
-        if  PlatformDataBase != None:\r
-            if InfFileKey in PlatformDataBase.Modules:\r
-                DscArchList.append ('X64')\r
-\r
-        PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'IPF', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
-        if PlatformDataBase != None:\r
-            if InfFileKey in (PlatformDataBase.Modules):\r
-                DscArchList.append ('IPF')\r
-\r
-        PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'ARM', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
-        if PlatformDataBase != None:\r
-            if InfFileKey in (PlatformDataBase.Modules):\r
-                DscArchList.append ('ARM')\r
-\r
-        PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'EBC', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
-        if PlatformDataBase != None:\r
-            if InfFileKey in (PlatformDataBase.Modules):\r
-                DscArchList.append ('EBC')\r
-\r
-        PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'AARCH64', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
-        if PlatformDataBase != None:\r
-            if InfFileKey in (PlatformDataBase.Modules):\r
-                DscArchList.append ('AARCH64')\r
+        for Arch in GenFdsGlobalVariable.ArchList :\r
+            PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
+            if  PlatformDataBase != None:\r
+                if InfFileKey in PlatformDataBase.Modules:\r
+                    DscArchList.append (Arch)\r
 \r
         return DscArchList\r
 \r
index b2c4d6e4dafbf7657b2ef202eaebb0b9adbdc3f1..34bc48a0d35994ea012752c5eb8a06d72e2be8b4 100644 (file)
@@ -2,6 +2,7 @@
 # This file is used to create a database used by build tool\r
 #\r
 # Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<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
@@ -543,6 +544,13 @@ class DscBuildData(PlatformBuildClassObject):
         Macros["EDK_SOURCE"] = GlobalData.gEcpSource\r
         for Record in RecordList:\r
             DuplicatedFile = False\r
+\r
+            # process only records COMMON and self.Arch\r
+            SectionArch = Record[3].upper()\r
+            if SectionArch != 'COMMON':\r
+                if SectionArch != self.Arch:\r
+                    continue\r
+\r
             ModuleFile = PathClass(NormPath(Record[0], Macros), GlobalData.gWorkspace, Arch=self._Arch)\r
             ModuleId = Record[5]\r
             LineNo = Record[6]\r