Skip to content

Commit

Permalink
Run just built java -version
Browse files Browse the repository at this point in the history
...to make at least a some basic check that built JDK
is sort of working.
  • Loading branch information
janvrany committed Mar 11, 2022
1 parent 707df17 commit b171395
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
16 changes: 16 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
#!/bin/bash

set -e

HERE=$(realpath $(dirname $0))

. "${HERE}/setup.sh"

make JOBS=1 -C openj9-openjdk-jdk11 all

arch="${TARGET%%-*}"
builddir="${HERE}/openj9-openjdk-jdk11/build/$(ls "${HERE}/openj9-openjdk-jdk11/build" | grep "linux-${arch}-*")"

if test "${HOST}" != "${TARGET}"; then
qemu=$(type -P qemu-${arch}-static)
if [[ -z "${qemu}" ]]; then
"WARN: no ${qemu} found, cannot test / output 'java -version'!"
else
${qemu} -L "${SYSROOT}" "${builddir}/images/jdk/bin/java" -version
fi
else
"${builddir}/images/jdk/bin/java" -version
fi
12 changes: 1 addition & 11 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@ HERE=$(realpath $(dirname $0))
extra_configure_args=""

if [[ "${HOST}" != "${TARGET}" ]]; then
extra_configure_args="${extra_configure_args} --disable-ddr --openjdk-target=$TARGET"
if [[ "${TARGET}" == "riscv64-linux-gnu" ]]; then
if [ -d "/opt/riscv/sysroot" ]; then
sysroot="/opt/riscv/sysroot"
elif [ -d "/opt/cross/riscv64" ]; then
sysroot="/opt/cross/riscv64"
else
echo "ERROR: no cross-compilation sysroot found!"
fi
extra_configure_args="${extra_configure_args} --with-sysroot=$sysroot"
fi
extra_configure_args="${extra_configure_args} --disable-ddr --openjdk-target=$TARGET --with-sysroot=${SYSROOT}"
fi

pushd openj9-openjdk-jdk11
Expand Down
9 changes: 9 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ if test "${HOST}" != "${TARGET}" -a "${TARGET}" == "riscv64-linux-gnu"; then
if [[ -f "/usr/bin/riscv64-linux-gnu-g++" ]]; then
export RISCV_TOOLCHAIN_TYPE=install
fi

if [ -d "/opt/riscv/sysroot" ]; then
SYSROOT="/opt/riscv/sysroot"
elif [ -d "/opt/cross/riscv64" ]; then
SYSROOT="/opt/cross/riscv64"
else
echo "ERROR: no cross-compilation sysroot found!"
exit 2
fi
fi

CFLAGS="-gdwarf-4"
Expand Down

0 comments on commit b171395

Please sign in to comment.