diff options
-rw-r--r-- | openjdk/openjdk.build | 2 | ||||
-rw-r--r-- | openjdk/response.txt | 17 | ||||
-rw-r--r-- | runtime/runtime.build | 4 | ||||
-rw-r--r-- | tools/tools.build | 6 | ||||
-rw-r--r-- | tools/updbaseaddresses.cs | 69 |
5 files changed, 96 insertions, 2 deletions
diff --git a/openjdk/openjdk.build b/openjdk/openjdk.build index 31a177b2..f5ef4160 100644 --- a/openjdk/openjdk.build +++ b/openjdk/openjdk.build @@ -147,6 +147,8 @@ <include name="IKVM.OpenJDK.*.dll" /> </fileset> </copy> + <!-- update base addresses in response.txt for next build --> + <exec program="${project::get-base-directory()}/../tools/updbaseaddresses.exe" commandline="response.txt" useruntimeengine="true" /> </target> </project> diff --git a/openjdk/response.txt b/openjdk/response.txt index f35e5e1e..f287fe68 100644 --- a/openjdk/response.txt +++ b/openjdk/response.txt @@ -1,6 +1,7 @@ assembly.class { -out:IKVM.OpenJDK.Core.dll + -baseaddress:0x56000000 -remap:map.xml -exclude:exclude.lst -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/META-INF/MANIFEST.MF @@ -124,6 +125,7 @@ assembly.class } { -out:IKVM.OpenJDK.Corba.dll + -baseaddress:0x56D50000 -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/corba/* ../../openjdk6-b16/build/linux-amd64/impsrc/com/sun/corba/se/impl/activation/*.class ../../openjdk6-b16/build/linux-amd64/impsrc/com/sun/corba/se/impl/copyobject/*.class @@ -234,6 +236,7 @@ assembly.class } { -out:IKVM.OpenJDK.XML.API.dll + -baseaddress:0x57410000 ../../openjdk6-b16/build/linux-amd64/impsrc/javax/xml/*.class ../../openjdk6-b16/build/linux-amd64/impsrc/javax/xml/datatype/*.class ../../openjdk6-b16/build/linux-amd64/impsrc/javax/xml/namespace/*.class @@ -265,6 +268,7 @@ assembly.class } { -out:IKVM.OpenJDK.XML.Parse.dll + -baseaddress:0x574D0000 -resource:com/sun/org/apache/xml/internal/serialize/HTMLEntities.res=../../openjdk6-b16/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/serialize/HTMLEntities.res -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/org/apache/xalan/internal/res/* -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/org/apache/xerces/* @@ -340,6 +344,7 @@ assembly.class } { -out:IKVM.OpenJDK.XML.Transform.dll + -baseaddress:0x57E90000 ../../openjdk6-b16/build/linux-amd64/impsrc/com/sun/java_cup/internal/runtime/*.class ../../openjdk6-b16/build/linux-amd64/impsrc/com/sun/org/apache/bcel/internal/*.class ../../openjdk6-b16/build/linux-amd64/impsrc/com/sun/org/apache/bcel/internal/classfile/*.class @@ -363,6 +368,7 @@ assembly.class } { -out:IKVM.OpenJDK.XML.Bind.dll + -baseaddress:0x582E0000 -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/javax/xml/bind/* -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/xml/internal/bind/* -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/xml/internal/fastinfoset/* @@ -429,6 +435,7 @@ assembly.class } { -out:IKVM.OpenJDK.XML.WebServices.dll + -baseaddress:0x58790000 -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/xml/internal/messaging/* -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/xml/internal/ws/* ../../openjdk6-b16/build/linux-amd64/impsrc/com/sun/xml/internal/dtdparser/*.class @@ -519,6 +526,7 @@ assembly.class } { -out:IKVM.OpenJDK.XML.RelaxNG.dll + -baseaddress:0x58BB0000 ../../openjdk6-b16/build/linux-amd64/impsrc/com/sun/xml/internal/rngom/ast/builder/*.class ../../openjdk6-b16/build/linux-amd64/impsrc/com/sun/xml/internal/rngom/ast/om/*.class ../../openjdk6-b16/build/linux-amd64/impsrc/com/sun/xml/internal/rngom/ast/util/*.class @@ -540,6 +548,7 @@ assembly.class } { -out:IKVM.OpenJDK.XML.Crypto.dll + -baseaddress:0x58CA0000 -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/org/apache/xml/internal/security/* ../../openjdk6-b16/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/*.class ../../openjdk6-b16/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/*.class @@ -575,6 +584,7 @@ assembly.class } { -out:IKVM.OpenJDK.SwingAWT.dll + -baseaddress:0x58DF0000 -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/META-INF/services/sun.java2d.* -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/java/swing/* -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/javax/swing/* @@ -653,11 +663,13 @@ assembly.class } { -out:IKVM.OpenJDK.Charsets.dll + -baseaddress:0x59CC0000 ../../openjdk6-b16/jdk/src/share/classes/sun/io/*.class ../../openjdk6-b16/jdk/src/share/classes/sun/nio/cs/ext/*.class } { -out:IKVM.OpenJDK.Util.dll + -baseaddress:0x5AB30000 java/util/zip/*.class ../../openjdk6-b16/build/linux-amd64/gensrc/sun/util/logging/resources/*.class ../../openjdk6-b16/build/linux-amd64/gensrc/sun/util/resources/*.class @@ -673,6 +685,7 @@ assembly.class } { -out:IKVM.OpenJDK.Text.dll + -baseaddress:0x5AE60000 -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/sun/text/* java/text/*.class ../../openjdk6-b16/jdk/src/share/classes/java/text/*.class @@ -683,6 +696,7 @@ assembly.class } { -out:IKVM.OpenJDK.Security.dll + -baseaddress:0x5B040000 sun/security/jgss/wrapper/*.class ../../openjdk6-b16/jdk/src/share/classes/com/sun/crypto/provider/*.class ../../openjdk6-b16/jdk/src/share/classes/com/sun/net/ssl/*.class @@ -746,6 +760,7 @@ assembly.class } { -out:IKVM.OpenJDK.Management.dll + -baseaddress:0x5B790000 ConnectorBootstrap$DefaultValues.class ConnectorBootstrap.class icedtea/rt/com/sun/jmx/snmp/*.class @@ -784,6 +799,7 @@ assembly.class } { -out:IKVM.OpenJDK.Misc.dll + -baseaddress:0x5BBB0000 -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/META-INF/services/javax.print.* -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/META-INF/services/javax.sound.* -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/imageio/plugins/common/iio-plugin.properties @@ -968,6 +984,7 @@ assembly.class } { -out:IKVM.OpenJDK.Jdbc.dll + -baseaddress:0x5C2A0000 -resource:META-INF/services/java.sql.Driver=resources/META-INF/services/java.sql.Driver -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/rowset/* -recurse:../../openjdk6-b16/build/linux-amd64/j2re-image/lib/resources.jar/javax/sql/* diff --git a/runtime/runtime.build b/runtime/runtime.build index ed54b9d2..d38dea8a 100644 --- a/runtime/runtime.build +++ b/runtime/runtime.build @@ -20,7 +20,7 @@ </replacetokens> </filterchain> </copy> - <csc noconfig="true" target="library" output="IKVM.Runtime.JNI.dll" define="${defs}" optimize="true" unsafe="true" rebuild="true"> + <csc noconfig="true" target="library" output="IKVM.Runtime.JNI.dll" define="${defs}" optimize="true" unsafe="true" baseaddress="0x55300000" rebuild="true"> <sources> <include name="../CommonAssemblyInfo.cs" /> <include name="JniAssemblyInfo.cs" /> @@ -60,7 +60,7 @@ <if test="${not first-pass}"> <call target="IKVM.Runtime.JNI" /> </if> - <csc noconfig="true" target="library" output="IKVM.Runtime.dll" define="${defs}" optimize="true" unsafe="false" rebuild="true"> + <csc noconfig="true" target="library" output="IKVM.Runtime.dll" define="${defs}" optimize="true" unsafe="false" baseaddress="0x55000000" rebuild="true"> <sources> <include name="../CommonAssemblyInfo.cs" /> <include name="AssemblyInfo.cs" /> diff --git a/tools/tools.build b/tools/tools.build index c9883ab4..df76059a 100644 --- a/tools/tools.build +++ b/tools/tools.build @@ -7,6 +7,12 @@ </sources> </csc> + <csc target="exe" output="updbaseaddresses.exe" optimize="true"> + <sources> + <include name="updbaseaddresses.cs" /> + </sources> + </csc> + <if test="${property::exists('signed')}"> <property name="defs" value="${signed}" /> </if> diff --git a/tools/updbaseaddresses.cs b/tools/updbaseaddresses.cs new file mode 100644 index 00000000..d94c5f12 --- /dev/null +++ b/tools/updbaseaddresses.cs @@ -0,0 +1,69 @@ +/* + Copyright (C) 2009 Jeroen Frijters + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jeroen Frijters + jeroen@frijters.net + +*/ + +using System; +using System.Collections.Generic; +using System.IO; + +/* + * This tool updates the -baseaddress options in response.txt based on the current file sizes. + * + * Usage: updbaseaddresses \ikvm\openjdk\response.txt + */ + +class UpdateBaseAddresses +{ + static void Main(string[] args) + { + string[] input = File.ReadAllLines(args[0]); + List<string> output = new List<string>(); + int baseAddress = 0x56000000; + string dir = Path.GetDirectoryName(args[0]); + bool dirty = false; + for (int i = 0; i < input.Length; i++) + { + string line = input[i]; + if (!line.Contains("-baseaddress:")) + { + output.Add(line); + } + if (line.Trim().StartsWith("-out:")) + { + string str = String.Format(" -baseaddress:0x{0:X}", baseAddress); + output.Add(str); + if (str != input[i + 1]) + { + dirty = true; + } + string file = line.Trim().Substring(5); + FileInfo fileInfo = new FileInfo(Path.Combine(dir, file)); + baseAddress += 3 * (((int)fileInfo.Length + 65535) / 65536) * 65536; + } + } + if (dirty) + { + File.WriteAllLines(args[0], output.ToArray()); + } + } +} |