]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fixed issue of incorrect Module Unique Name
authorFeng, Bob C <bob.c.feng@intel.com>
Fri, 16 Aug 2019 05:52:46 +0000 (13:52 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Mon, 19 Aug 2019 01:06:14 +0000 (09:06 +0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=2088
If there are more than one override instance for a same module,
the Module Unique Name is generated incorrectly.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
BaseTools/Source/Python/AutoGen/PlatformAutoGen.py

index 9ecf5c2dbe0c0532fa256e052929e33aa50d58f6..076ce0e39c37cc4661d4aa27dfe07ae751842925 100644 (file)
@@ -295,7 +295,7 @@ class ModuleAutoGen(AutoGen):
         ModuleNames = self.DataPipe.Get("M_Name")\r
         if not ModuleNames:\r
             return self.Name\r
-        return ModuleNames.get(self.Name,self.Name)\r
+        return ModuleNames.get((self.Name,self.MetaFile),self.Name)\r
 \r
     # Macros could be used in build_rule.txt (also Makefile)\r
     @cached_property\r
index 4abfc6c29d1b803e23c91d76280c252fa6fa29f7..dd629ba2fac237575d3bd2322726beea5d2628c7 100644 (file)
@@ -1366,14 +1366,15 @@ class PlatformAutoGen(AutoGen):
                 UniqueName[Module.BaseName] = set()\r
             UniqueName[Module.BaseName].add((self.ModuleGuid(Module),Module.MetaFile))\r
         for module_paths in ModuleNameDict.values():\r
-            if len(module_paths) > 1 and len(set(module_paths))>1:\r
+            if len(set(module_paths))>1:\r
                 samemodules = list(set(module_paths))\r
                 EdkLogger.error("build", FILE_DUPLICATED, 'Modules have same BaseName and FILE_GUID:\n'\r
                                     '  %s\n  %s' % (samemodules[0], samemodules[1]))\r
         for name in UniqueName:\r
             Guid_Path = UniqueName[name]\r
             if len(Guid_Path) > 1:\r
-                retVal[name] = '%s_%s' % (name,Guid_Path.pop()[0])\r
+                for guid,mpath in Guid_Path:\r
+                    retVal[(name,mpath)] = '%s_%s' % (name,guid)\r
         return retVal\r
     ## Expand * in build option key\r
     #\r