--- a/hotspot/src/share/tools/hsdis/README Tue Apr 14 12:25:54 2009 -0700
+++ b/hotspot/src/share/tools/hsdis/README Wed Apr 15 09:53:54 2009 -0700
@@ -32,61 +32,55 @@
* Building
-To build this project you need a build of Gnu binutils to link against.
-It is known to work with binutils 2.17.
-
-The makefile looks for this build in $BINUTILS, or (if that is not set),
-in .../binutils-2.17-$LIBARCH, where LIBARCH (as in HotSpot) is one of
-the jre subdirectory keywords i386, amd64, sparc, sparcv9, etc.
-
-To build Gnu binutils, first download a copy of the software:
- http://directory.fsf.org/project/binutils/
+To build this project you a copy of GNU binutils to build against. It
+is known to work with binutils 2.17 and binutils 2.19.1. Download a
+copy of the software from http://directory.fsf.org/project/binutils or
+one of it's mirrors. Builds targetting windows should use at least
+2.19 and currently requires the use of a cross compiler.
-Unpack the binutils tarball into an empty directory:
- chdir ../../../../..
- tar -xzf - < ../binutils-2.17.tar.gz
- mv binutils-2.17 binutils-2.17-i386 #or binutils-2.17-sparc
- cd binutils-2.17-i386
+The makefile looks for the sources in build/binutils or you can
+specify it's location to the makefile using BINTUILS=path. It will
+configure binutils and build it first and then build and link the
+disasembly adapter. Make all will build the default target for your
+platform. If you platform support both 32 and 64 simultaneously then
+"make both" will build them both at once. "make all64" will
+explicitly build the 64 bit version. By default this will build the
+disassembler library only. If you build demo it will build a demo
+program that attempts to exercise the library.
-From inside that directory, run configure and make:
- ( export CFLAGS='-fPIC'
- ./configure i386-pc-elf )
- gnumake
-
-(Leave out or change the argument to configure if not on an i386 system.)
+Windows
-Next, untar again into another empty directory for the LP64 version:
- chdir ..
- tar -xzf - < ../binutils-2.17.tar.gz
- mv binutils-2.17 binutils-2.17-amd64 #or binutils-2.17-sparcv9
- cd binutils-2.17-amd64
-
-From inside that directory, run configure for LP64 and make:
- ( export ac_cv_c_bigendian=no CFLAGS='-m64 -fPIC' LDFLAGS=-m64
- ./configure amd64-pc-elf )
- gnumake
+In theory this should be buildable on Windows but getting a working
+GNU build environment on Windows has proven difficult. MINGW should
+be able to do it but at the time of this writing I was unable to get
+this working. Instead you can use the mingw cross compiler on linux
+to produce the windows binaries. For 32-bit windows you can install
+mingw32 using your package manager and it will be added to your path
+automatically. For 64-bit you need to download the 64 bit mingw from
+http://sourceforge.net/projects/mingw-w64. Grab a copy of the
+complete toolchain and unpack it somewhere. Put the bin directory of
+the toolchain in your path. The mingw installs contain cross compile
+versions of gcc that are named with a prefix to indicate what they are
+targetting and you must tell the Makefile which one to use. This
+should either be i586-mingw32msvc or x86_64-pc-mingw32 depending on
+which on you are targetting and there should be a version of gcc in
+your path named i586-mingw32msvc-gcc or x86_64-pc-mingw32-gcc. Tell
+the makefile what prefix to use to find the mingw tools by using
+MINGW=. For example:
-The -fPIC option is needed because the generated code will be
-linked into the hsdid-$LIBARCH.so binary. If you miss the
-option, the JVM will fail to load the disassembler.
+make MINGW=i586-mingw32msvc BINTUILS=build/binutils-2.19.1
-You probably want two builds, one for 32 and one for 64 bits.
-To build the 64-bit variation of a platforn, add LP64=1 to
-the make command line for hsdis.
-
-So, go back to the hsdis project and build:
- chdir .../hsdis
- gnumake
- gnumake LP64=1
+will build the Win32 cross compiled version of hsdis based on 2.19.1.
* Installing
-Products are named like bin/$OS/hsdis-$LIBARCH.so.
-You can install them on your LD_LIBRARY_PATH,
-or inside of your JRE next to $LIBARCH/libjvm.so.
+Products are named like build/$OS-$LIBARCH/hsdis-$LIBARCH.so. You can
+install them on your LD_LIBRARY_PATH, or inside of your JRE next to
+$LIBARCH/libjvm.so.
Now test:
- export LD_LIBRARY_PATH .../hsdis/bin/solaris:$LD_LIBRARY_PATH
+
+ export LD_LIBRARY_PATH .../hsdis/build/$OS-$LIBARCH:$LD_LIBRARY_PATH
dargs='-XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly'
dargs=$dargs' -XX:PrintAssemblyOptions=hsdis-print-bytes'
java $dargs -Xbatch CompileCommand=print,*String.hashCode HelloWorld