summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorThomas Palmer <thomas.palmer@hpe.com>2016-04-16 09:45:02 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-04-19 10:30:54 +0800
commit77177984087654ff2888e182d40c20480da29811 (patch)
tree222a59e35952e0133a80b6f40ca039f1d25a91c9 /BaseTools
parent0b42d7d8a34a99a02becf4dece78481d3cd2b2fc (diff)
downloadedk2-platforms-77177984087654ff2888e182d40c20480da29811.tar.xz
BaseTools/Build: Consider only build-specified architectures
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>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/GenFds/FfsInfStatement.py36
-rw-r--r--BaseTools/Source/Python/Workspace/WorkspaceDatabase.py8
2 files changed, 14 insertions, 30 deletions
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
index 864e5be7d9..3c59f14aa8 100644
--- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
@@ -2,7 +2,7 @@
# process FFS generation from INF statement
#
# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
-# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.<BR>
+# Copyright (c) 2014-2016 Hewlett-Packard Development Company, L.P.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -555,35 +555,11 @@ class FfsInfStatement(FfsInfStatementClassObject):
InfFileKey = os.path.normpath(mws.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName))
DscArchList = []
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'IA32', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in PlatformDataBase.Modules:
- DscArchList.append ('IA32')
-
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'X64', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in PlatformDataBase.Modules:
- DscArchList.append ('X64')
-
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'IPF', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in (PlatformDataBase.Modules):
- DscArchList.append ('IPF')
-
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'ARM', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in (PlatformDataBase.Modules):
- DscArchList.append ('ARM')
-
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'EBC', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in (PlatformDataBase.Modules):
- DscArchList.append ('EBC')
-
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'AARCH64', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in (PlatformDataBase.Modules):
- DscArchList.append ('AARCH64')
+ for Arch in GenFdsGlobalVariable.ArchList :
+ PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
+ if PlatformDataBase != None:
+ if InfFileKey in PlatformDataBase.Modules:
+ DscArchList.append (Arch)
return DscArchList
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
index b2c4d6e4da..34bc48a0d3 100644
--- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
+++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
@@ -2,6 +2,7 @@
# This file is used to create a database used by build tool
#
# Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>
+# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
# 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
@@ -543,6 +544,13 @@ class DscBuildData(PlatformBuildClassObject):
Macros["EDK_SOURCE"] = GlobalData.gEcpSource
for Record in RecordList:
DuplicatedFile = False
+
+ # process only records COMMON and self.Arch
+ SectionArch = Record[3].upper()
+ if SectionArch != 'COMMON':
+ if SectionArch != self.Arch:
+ continue
+
ModuleFile = PathClass(NormPath(Record[0], Macros), GlobalData.gWorkspace, Arch=self._Arch)
ModuleId = Record[5]
LineNo = Record[6]