How to build hsdis-amd64.dll and hsdis-i386.dll on Windows

  1. Install Cygwin. At the Select Packages screen, add the following packages (by expanding the Devel category, then clicking once on the Skip label next to each package name):
  2. Run the Cygwin Terminal. This can be done using the Desktop or Start Menu icon created by the installer, and will create your Cygwin home directory (C:\cygwin\home\username or C:\cygwin64\home\username, by default).
  3. Download the latest GNU binutils source package and extract its contents to your Cygwin home directory. At the time of writing, the latest package is binutils-2.24.tar.bz2. This should result in a directory named binutils-2.24 (or whatever the latest version is) in your Cygwin home directory.
  4. Download the OpenJDK source by going to the JDK 8 Updates repository, selecting the tag corresponding to your installed JRE version, and clicking bz2. Extract the hsdis directory (found in src\share\tools) to your Cygwin home directory.
  5. In the Cygwin Terminal, enter cd hsdis.
  6. To build hsdis-amd64.dll, enter make OS=Linux MINGW=x86_64-w64-mingw32 'AR=$(MINGW)-ar' BINUTILS=~/binutils-2.24. To build hsdis-i386.dll, enter make OS=Linux MINGW=i686-w64-mingw32 'AR=$(MINGW)-ar' BINUTILS=~/binutils-2.24. In either case, replace 2.24 with the binutils version you downloaded.

The DLL can now be installed by copying it from hsdis\build\Linux-amd64 or hsdis\build\Linux-i586 to your JRE’s bin\server or bin\client directory.

Note that binutils and OpenJDK use incompatible licenses. As I understand it, this means that it is legal to combine them for personal use, but not to distribute the result. Because of this, I cannot provide prebuilt DLLs.

Bonus tip: if you prefer Intel ASM syntax to AT&T, specify -XX:PrintAssemblyOptions=intel alongside any other PrintAssembly options you use.