BaseTools: Fix one or more multiply defined symbols found issue
authorFeng, YunhuaX <yunhuax.feng@intel.com>
Fri, 13 Apr 2018 05:20:31 +0000 (13:20 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Sun, 15 Apr 2018 00:39:31 +0000 (08:39 +0800)
self.Guids update with package Guids will generate multiply defined
GUID symbols in AutoGen file

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/Workspace/InfBuildData.py

index e10873ae59033485d78a998bdb25201705703d4e..38165cb8a754d96e595426902d52666213efcd65 100644 (file)
@@ -997,6 +997,7 @@ class InfBuildData(ModuleBuildClassObject):
             self._PcdComments[TokenSpaceGuid, PcdCName] = Comments\r
 \r
         # resolve PCD type, value, datum info, etc. by getting its definition from package\r
+        _GuidDict = self.Guids.copy()\r
         for PcdCName, TokenSpaceGuid in PcdList:\r
             PcdRealName = PcdCName\r
             Setting, LineNo = PcdDict[self._Arch, self.Platform, PcdCName, TokenSpaceGuid]\r
@@ -1050,7 +1051,7 @@ class InfBuildData(ModuleBuildClassObject):
                 #\r
                 #   "FixedAtBuild", "PatchableInModule", "FeatureFlag", "Dynamic", "DynamicEx"\r
                 #\r
-                self.Guids.update(Package.Guids)\r
+                _GuidDict.update(Package.Guids)\r
                 PcdType = self._PCD_TYPE_STRING_[Type]\r
                 if Type == MODEL_PCD_DYNAMIC:\r
                     Pcd.Pending = True\r
@@ -1142,7 +1143,7 @@ class InfBuildData(ModuleBuildClassObject):
                         Pcd.DefaultValue = PcdInPackage.DefaultValue\r
                     else:\r
                         try:\r
-                            Pcd.DefaultValue = ValueExpressionEx(Pcd.DefaultValue, Pcd.DatumType, self.Guids)(True)\r
+                            Pcd.DefaultValue = ValueExpressionEx(Pcd.DefaultValue, Pcd.DatumType, _GuidDict)(True)\r
                         except BadExpression, Value:\r
                             EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Value "%s", %s' %(TokenSpaceGuid, PcdRealName, Pcd.DefaultValue, Value),\r
                                             File=self.MetaFile, Line=LineNo)\r