Build hsdis for JDK 1.8 on Ubuntu

I wanted to build hsdis for my Ubuntu system. Virtually all of the instructions out there are slightly wrong. As per the comment on this gist a recent change (bbd1da3f538f) to the HotSpot source to be compatible with binutils 2.29 broke all the prior instructions. So literally.. my contribution here is to publicly point this out and offer copy and pasta instructions to solve it.

sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev g++-multilib mercurial texinfo
hg clone
cd jdk8u
hg update jdk8u92-b14
sed -ri 's/subrepos="[^"]+"/subrepos="hotspot"/' ./make/scripts/ # only get hotspot
sed -ri 's/subrepos="[^"]+"/subrepos="hotspot"/' ./common/bin/ # only get hotspot
chmod +x ./; ./
cd hotspot/src/share/tools/hsdis
tar -xzf binutils-2.29.tar.gz
sed -ri 's/development=.*/development=false/' ./binutils-2.29/bfd/ # set development to false
make BINUTILS=binutils-2.29 ARCH=amd64
sudo cp build/linux-amd64/ /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/


Rate this post

Leave a Comment