Skip to content

Commit

Permalink
Configure JDK19+ on Linux with hsdis capstone support
Browse files Browse the repository at this point in the history
  • Loading branch information
sxa committed Jul 6, 2023
1 parent 60358cd commit 1613361
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build-farm/platform-specific-configurations/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,12 @@ elif [ -r /usr/bin/gcc-7 ]; then
[ -r /usr/bin/g++-7 ] && export CXX=/usr/bin/g++-7
fi

if [ "$JAVA_FEATURE_VERSION" -ge 20 ]; then
if [ -r /usr/local/lib/libcapstone.so.4 ]; then
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-capstone=/usr/local"
fi
fi

if [ "${VARIANT}" == "${BUILD_VARIANT_BISHENG}" ]; then
# BUILD_C/CXX required for native (non-cross) RISC-V builds of Bisheng
if [ -n "$CXX" ]; then
Expand Down
14 changes: 14 additions & 0 deletions sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ configureShenandoahBuildParameter() {
fi
}

# capstone disassembler support is available in JDK19+
configureCapstoneBuildParameter() {
if [[ "${BUILD_CONFIG[OPENJDK_FEATURE_NUMBER]}" -ge 19 && "${BUILD_CONFIG[OS_KERNEL_NAME]}" = "linux" ]]; then
if [ "${ARCHITECTURE}" = "x64" -o "${ARCHITECTURE}" = "aarch64 " ]; then
echo Configuring with hsdis capstone bundling support
addConfigureArg "--enable-hsdis-bundling" ""
addConfigureArg "--with-hsdis=" "capstone"
addConfigureArg "--with-capstone=" "/usr/local"
else
echo Configuring without hsdis/capstone support as we are not building on x64 or aarch64
fi
fi
}
# Configure reproducible build
# jdk-17 and jdk-19+ support reproducible builds
configureReproducibleBuildParameter() {
Expand Down Expand Up @@ -492,6 +505,7 @@ configureFreetypeLocation() {
configureCommandParameters() {
configureVersionStringParameter
configureBootJDKConfigureParameter
configureCapstoneBuildParameter
configureShenandoahBuildParameter
configureMacOSCodesignParameter
configureDebugParameters
Expand Down

0 comments on commit 1613361

Please sign in to comment.