Skip to content

Commit 1613361

Browse files
committed
Configure JDK19+ on Linux with hsdis capstone support
1 parent 60358cd commit 1613361

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

build-farm/platform-specific-configurations/linux.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,12 @@ elif [ -r /usr/bin/gcc-7 ]; then
338338
[ -r /usr/bin/g++-7 ] && export CXX=/usr/bin/g++-7
339339
fi
340340

341+
if [ "$JAVA_FEATURE_VERSION" -ge 20 ]; then
342+
if [ -r /usr/local/lib/libcapstone.so.4 ]; then
343+
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-capstone=/usr/local"
344+
fi
345+
fi
346+
341347
if [ "${VARIANT}" == "${BUILD_VARIANT_BISHENG}" ]; then
342348
# BUILD_C/CXX required for native (non-cross) RISC-V builds of Bisheng
343349
if [ -n "$CXX" ]; then

sbin/build.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ configureShenandoahBuildParameter() {
9090
fi
9191
}
9292

93+
# capstone disassembler support is available in JDK19+
94+
configureCapstoneBuildParameter() {
95+
if [[ "${BUILD_CONFIG[OPENJDK_FEATURE_NUMBER]}" -ge 19 && "${BUILD_CONFIG[OS_KERNEL_NAME]}" = "linux" ]]; then
96+
if [ "${ARCHITECTURE}" = "x64" -o "${ARCHITECTURE}" = "aarch64 " ]; then
97+
echo Configuring with hsdis capstone bundling support
98+
addConfigureArg "--enable-hsdis-bundling" ""
99+
addConfigureArg "--with-hsdis=" "capstone"
100+
addConfigureArg "--with-capstone=" "/usr/local"
101+
else
102+
echo Configuring without hsdis/capstone support as we are not building on x64 or aarch64
103+
fi
104+
fi
105+
}
93106
# Configure reproducible build
94107
# jdk-17 and jdk-19+ support reproducible builds
95108
configureReproducibleBuildParameter() {
@@ -492,6 +505,7 @@ configureFreetypeLocation() {
492505
configureCommandParameters() {
493506
configureVersionStringParameter
494507
configureBootJDKConfigureParameter
508+
configureCapstoneBuildParameter
495509
configureShenandoahBuildParameter
496510
configureMacOSCodesignParameter
497511
configureDebugParameters

0 commit comments

Comments
 (0)