Added a workaround to fix the library instance constructor sequence issue.
authorjwang36 <jwang36@de2fecce-e211-0410-80a6-f3fac2684e05>
Thu, 11 Jan 2007 09:00:36 +0000 (09:00 +0000)
committerjwang36 <jwang36@de2fecce-e211-0410-80a6-f3fac2684e05>
Thu, 11 Jan 2007 09:00:36 +0000 (09:00 +0000)
git-svn-id: https://edk2.tianocore.org/svn/edk2/trunk@2221 de2fecce-e211-0410-80a6-f3fac2684e05

edk2/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java

index 11469a6..8fb1be5 100644 (file)
@@ -223,8 +223,18 @@ public class AutogenLibOrder {
         // Append the remaining library instance to the end of sorted list\r
         // \r
         for (int i = 0; i < libInstanceList.length; ++i) {\r
+            if (libInstanceConsumedBy.get(libInstanceList[i]).size() > 0 && libInstanceList[i].hasConstructor()) {\r
+                EdkLog.log(EdkLog.EDK_ERROR, libInstanceList[i].getName()\r
+                           + " with constructor has a circular dependency!");\r
+                // throw new AutoGenException("Circular dependency in library instances is found!");\r
+            }\r
+\r
             if (!orderList.contains(libInstanceList[i])) {\r
-                orderList.add(libInstanceList[i]);\r
+                if (libInstanceList[i].getName().equals("UefiBootServicesTableLib")) {\r
+                    orderList.addFirst(libInstanceList[i]);\r
+                } else {\r
+                    orderList.add(libInstanceList[i]);\r
+                }\r
             }\r
         }\r
         return orderList;\r