Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PKGBUILD for JDK9 hsdis
# Maintainer: Tavian Barnes <tavianator@tavianator.com>
pkgname=java9-openjdk-hsdis
pkgver=9.u181
_binutils_ver=2.27
_repo_ver=4a443796f6f5
pkgrel=1
pkgdesc="Disassembler for HotSpot"
arch=('i686' 'x86_64')
url='http://openjdk.java.net/'
license=('GPL2')
_url_src=http://hg.openjdk.java.net/jdk9/jdk9
source=(hotspot-${_repo_ver}.tar.gz::${_url_src}/hotspot/archive/${_repo_ver}.tar.gz
http://ftp.gnu.org/gnu/binutils/binutils-${_binutils_ver}.tar.bz2)
sha256sums=('a7f330d233f07b9c5fb51dad00364e8167313a3f11bf86aee830980173e9c91b'
'369737ce51587f92466041a97ab7d2358c6d9e1b6490b3940eb09fb0a9a6ac88')
prepare() {
cd "${srcdir}/binutils-${_binutils_ver}"
# hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
cd "${srcdir}/hotspot-${_repo_ver}/src/share/tools/hsdis"
mkdir -p build
ln -sf "${srcdir}/binutils-${_binutils_ver}" build/binutils
}
build() {
cd "${srcdir}/hotspot-${_repo_ver}/src/share/tools/hsdis"
if [ "$CARCH" = "x86_64" ]; then
mkdir -p build/linux-amd64
cd build/linux-amd64
else
mkdir -p build/linux-i586
cd build/linux-i586
fi
../binutils/configure --prefix=/usr \
--with-lib-path=/usr/lib:/usr/local/lib \
--with-bugurl=https://bugs.archlinux.org/ \
--enable-threads --enable-shared --with-pic \
--enable-ld=default --enable-gold --enable-plugins \
--disable-werror --disable-gdb --disable-nls \
CFLAGS="$CFLAGS -fPIC"
make all-opcodes
cd ../..
if [ "$CARCH" = "x86_64" ]; then
make all LP64=1
else
make all
fi
}
package() {
cd "${srcdir}/hotspot-${_repo_ver}/src/share/tools/hsdis"
if [ "$CARCH" = "x86_64" ]; then
install -D -m755 build/linux-amd64/hsdis-amd64.so "${pkgdir}/usr/lib/jvm/java-9-openjdk/lib/hsdis-amd64.so"
else
install -D -m755 build/linux-i586/hsdis-i586.so "${pkgdir}/usr/lib/jvm/java-9-openjdk/lib/hsdis-i586.so"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment