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

  1. Install Cygwin. At the Select Packages screen, add the following packages (expand the All/Devel category, Search for the package’s name, and change the package’s New status from Skip to the latest non-Test version):
    • gcc-core
    • make
    • mingw64-i686-gcc-core (only needed for hsdis-i386.dll)
    • mingw64-x86_64-gcc-core (only needed for hsdis-amd64.dll)
  2. Run the Cygwin (or Cygwin64) 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 GNU binutils 2.32 to your Cygwin home directory, and extract it with tar xvf binutils-2.32.tar.xz.
  4. Download hsdis to your Cygwin home directory, and extract it with tar xvf jdk-jdk-13+16.tar.bz2.
  5. Change to the hsdis directory with cd jdk-jdk-13+16/src/utils/hsdis.
  6. Build hsdis-amd64.dll with make OS=Linux MINGW=x86_64-w64-mingw32 BINUTILS=~/binutils-2.32, or hsdis-i386.dll with make OS=Linux MINGW=i686-w64-mingw32 BINUTILS=~/binutils-2.32 DLDFLAGS='-shared -static-libgcc'.

Once built, the DLL can be installed by copying it from build/Linux-amd64 or build/Linux-i586 to your JRE’s bin/server or bin/client directory.

Bonus tip: -XX:PrintAssemblyOptions=options can be used to pass the same options accepted by objdump’s -M/--disassembler-options. For example, if you prefer Intel syntax to AT&T, specify -XX:PrintAssemblyOptions=intel-mnemonic.