summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Feng <bob.c.feng@intel.com>2019-09-05 17:45:10 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-09-10 08:39:16 +0800
commitcbe7543ebbf9bb3e8531a2235ff205713b569605 (patch)
tree459c0468eb48c1d5a2101d0ef4e75a1cd212d70b
parentf49421a47dca44c3cfc6d09dfa304239538e2648 (diff)
downloadedk2-cbe7543ebbf9bb3e8531a2235ff205713b569605.zip
edk2-cbe7543ebbf9bb3e8531a2235ff205713b569605.tar.gz
edk2-cbe7543ebbf9bb3e8531a2235ff205713b569605.tar.bz2
BaseTools: Fix a bug for Hii Pcd override
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2157 Hii Pcd links to a efi variable. The Variable default value is evaluated by related Hii Pcds setting. If multiple Hii Pcds links to one variable, and the offset overlap, the later Hii Pcds setting should be effective. There is a tool bug that is if the Pcds are in different dsc file which are included into the platform dsc file, build tool does not get the Pcds relative position correctly. That means build tool does not know which Pcd is the later one. As the result, the variable default value will be incorrect. This patch is to fix this bug. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
-rw-r--r--BaseTools/Source/Python/Workspace/DscBuildData.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index d2b5ccb..9192077 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -3014,7 +3014,7 @@ class DscBuildData(PlatformBuildClassObject):
# Remove redundant PCD candidates, per the ARCH and SKU
- for PcdCName, TokenSpaceGuid, SkuName, DefaultStore, Dummy4 in PcdList:
+ for index,(PcdCName, TokenSpaceGuid, SkuName, DefaultStore, Dummy4) in enumerate(PcdList):
Setting = PcdDict[self._Arch, SkuName, PcdCName, TokenSpaceGuid, DefaultStore]
if Setting is None:
@@ -3083,7 +3083,7 @@ class DscBuildData(PlatformBuildClassObject):
PcdClassObj.UserDefinedDefaultStoresFlag = True
Pcds[PcdCName, TokenSpaceGuid] = PcdClassObj
- Pcds[PcdCName, TokenSpaceGuid].CustomAttribute['DscPosition'] = int(Dummy4)
+ Pcds[PcdCName, TokenSpaceGuid].CustomAttribute['DscPosition'] = index
if SkuName not in Pcds[PcdCName, TokenSpaceGuid].DscRawValue:
Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] = {}
Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName] = {}