self.Guids update with package Guids will generate multiply defined
GUID symbols in AutoGen file

Cc: Liming Gao <liming....@intel.com>
Cc: Yonghong Zhu <yonghong....@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.f...@intel.com>
---
 BaseTools/Source/Python/Workspace/InfBuildData.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py 
b/BaseTools/Source/Python/Workspace/InfBuildData.py
index e10873ae59..38165cb8a7 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -995,10 +995,11 @@ class InfBuildData(ModuleBuildClassObject):
             for CmtRec in CommentRecords:
                 Comments.append(CmtRec[0])
             self._PcdComments[TokenSpaceGuid, PcdCName] = Comments
 
         # resolve PCD type, value, datum info, etc. by getting its definition 
from package
+        _GuidDict = self.Guids.copy()
         for PcdCName, TokenSpaceGuid in PcdList:
             PcdRealName = PcdCName
             Setting, LineNo = PcdDict[self._Arch, self.Platform, PcdCName, 
TokenSpaceGuid]
             if Setting is None:
                 continue
@@ -1048,11 +1049,11 @@ class InfBuildData(ModuleBuildClassObject):
                 # if platform doesn't give its type, use 'lowest' one in the
                 # following order, if any
                 #
                 #   "FixedAtBuild", "PatchableInModule", "FeatureFlag", 
"Dynamic", "DynamicEx"
                 #
-                self.Guids.update(Package.Guids)
+                _GuidDict.update(Package.Guids)
                 PcdType = self._PCD_TYPE_STRING_[Type]
                 if Type == MODEL_PCD_DYNAMIC:
                     Pcd.Pending = True
                     for T in ["FixedAtBuild", "PatchableInModule", 
"FeatureFlag", "Dynamic", "DynamicEx"]:
                         if (PcdRealName, TokenSpaceGuid) in 
GlobalData.MixedPcd:
@@ -1140,11 +1141,11 @@ class InfBuildData(ModuleBuildClassObject):
                     Pcd.InfDefaultValue = Pcd.DefaultValue
                     if Pcd.DefaultValue in [None, '']:
                         Pcd.DefaultValue = PcdInPackage.DefaultValue
                     else:
                         try:
-                            Pcd.DefaultValue = 
ValueExpressionEx(Pcd.DefaultValue, Pcd.DatumType, self.Guids)(True)
+                            Pcd.DefaultValue = 
ValueExpressionEx(Pcd.DefaultValue, Pcd.DatumType, _GuidDict)(True)
                         except BadExpression, Value:
                             EdkLogger.error('Parser', FORMAT_INVALID, 'PCD 
[%s.%s] Value "%s", %s' %(TokenSpaceGuid, PcdRealName, Pcd.DefaultValue, Value),
                                             File=self.MetaFile, Line=LineNo)
                     break
             else:
-- 
2.12.2.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to