From d919bb8cf91225ad4df49bdf50cd37795aadc7e6 Mon Sep 17 00:00:00 2001 From: jwang36 Date: Thu, 11 Jan 2007 09:00:36 +0000 Subject: [PATCH] Added a workaround to fix the library instance constructor sequence issue. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2221 6f19259b-4bc3-4df7-8a09-765794883524 --- .../org/tianocore/build/autogen/AutogenLibOrder.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java index 11469a6c49..8fb1be5cbe 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java @@ -223,8 +223,18 @@ public class AutogenLibOrder { // Append the remaining library instance to the end of sorted list // for (int i = 0; i < libInstanceList.length; ++i) { + if (libInstanceConsumedBy.get(libInstanceList[i]).size() > 0 && libInstanceList[i].hasConstructor()) { + EdkLog.log(EdkLog.EDK_ERROR, libInstanceList[i].getName() + + " with constructor has a circular dependency!"); + // throw new AutoGenException("Circular dependency in library instances is found!"); + } + if (!orderList.contains(libInstanceList[i])) { - orderList.add(libInstanceList[i]); + if (libInstanceList[i].getName().equals("UefiBootServicesTableLib")) { + orderList.addFirst(libInstanceList[i]); + } else { + orderList.add(libInstanceList[i]); + } } } return orderList;