Hi everyone!
I just tried on a FreeBSD platform:
# ./makejdk-any-platform.sh --build-variant openj9 --skip-freetype jdk8u
Result was:
configure: error: Unsupported OpenJ9 platform bsd!
configure exiting with result code 1
As Mac is supported with a somewhat similar kernel, I wonder what it would take to support *BSD systems.
I know the BSD platforms have become less popular since cloud services and docker on linux have arrived, but not having AIX or Darwin at hand, *BSD is a good way to test one's java applications on another platform.
I personally don't need it right away, just wanted to keep this open. Perhaps it is not too much effort at all, since Mac is already supported.
If you think that *BSD is not popular to support it, that's fine for me -- I don't use it a lot anyway.
~Basically this means that OpenJDK doesn't support bsd. Unless the check can be removed and the OpenJDK part of the build "just works", support for bsd needs to be added at the OpenJDK project before looking at supporting bsd for OpenJ9.~
Sorry, I got that wrong. The problem is here https://github.com/ibmruntimes/openj9-openjdk-jdk8/blob/017513304aa8a65971ea5082fb479c4afd7e6f8b/jdk/make/closed/autoconf/custom-hook.m4#L204
You can try copying the settings from the linux platfom and then see what the next problem is.
i.e. set
OPENJ9_PLATFORM_CODE=xa64
Then it will fail to find a spec file, so copy the linux one to the correct bsd name, and see what happens.
Thanks, I'll give you an update next week!
./jdk/make/closed/autoconf/generated-configure.sh also needs modification, in addidion to the custom-hook.m4 file.pkg install zippkg install cupsclang seems to be installed, I had(?) to install gcc as well../workspace/build/src/common/autoconf/configure.m4, I had to add the line: VALID_TOOLCHAINS_bsd="gcc clang". As the scripts were already generated, I also edited those../workspace/config/built_config.cfg, set MAKE_COMMAND_NAME=gmake../sbin/common/config_init.sh, set BUILD_CONFIG[MAKE_COMMAND_NAME]="gmake" (was: make).Because I wanted to keep the way of building via openjdk build script, I modified it so that it won't hard reset this cloned repo.
CC=/usr/local/bin/gcc ./makejdk-any-platform.sh --jdk-boot-dir /usr/local/openjdk7/ --build-variant openj9 --configure-args "--with-toolchain-type=gcc --with-toolchain-path=/usr/local/bin" ---skip-freetype jdk8u
Well, on the first invocation, this happened:
tar: tar: Error opening archive: Failed to open '/dev/sa0'
Failed to open '/dev/sa0'
gmake: *** [OpenJ9.gmk:320: stage-openj9-tools] Error 1
Error: Could not find or load main class com.ibm.jpp.commandline.CommandlineBuilder
gmake: *** [OpenJ9.gmk:453: /usr/ports/java/openjdk-build/workspace/build/src/build/bsd-x86_64-normal-server-release/jdk/j9jcl_sources/j9jcl_sources.done] Error 1
/usr/local/bin/gmake -s VERBOSE="-s" LOG_LEVEL="warn" -I /usr/ports/java/openjdk-build/workspace/build/src/make/common -f /usr/ports/java/openjdk-build/workspace/build/src/closed/openssl.gmk SPEC=/usr/ports/java/openjdk-build/workspace/build/src/build/bsd-x86_64-normal-server-release/spec.gmk
/usr/local/bin/gmake -s VERBOSE="-s" LOG_LEVEL="warn" -I /usr/ports/java/openjdk-build/workspace/build/src/make/common -f /usr/ports/java/openjdk-build/workspace/build/src/closed/OpenJ9.gmk SPEC=/usr/ports/java/openjdk-build/workspace/build/src/build/bsd-x86_64-normal-server-release/spec.gmk OPENJDK_VERSION_NUMBER_FOUR_POSITIONS=8.0.1920.12 build-j9
Staging OpenJ9 sourcetools in /usr/ports/java/openjdk-build/workspace/build/src/build/bsd-x86_64-normal-server-release/vm
tar: tar: Error opening archive: Failed to open '/dev/sa0'
Failed to open '/dev/sa0'
gmake[1]: *** [/usr/ports/java/openjdk-build/workspace/build/src/closed/OpenJ9.gmk:320: stage-openj9-tools] Error 1
gmake: *** [/usr/ports/java/openjdk-build/workspace/build/src/closed/make/Main.gmk:36: j9vm-build] Error 2
I checked out in /usr/ports/java/openjdk-build/, so no, this is not something official.
Btw: the error probably occurs due to different tar parameters.
The root of the problem is that there are a number of places where code is wrapped in ifdefs for OSX regardless of if its an OSX specific change or a change for bsd-like operating systems. That being said it wouldn't be terribly hard to go through and fix things, it's just not a triviy task
Was there any progress?
The FreeBSD issue was closed recently.
I guess there won't be any progress unless skilled people like @battleblow or @bsdkurt step it. Very sad. As a Maven PMC I'd like like to test everything with OpenJ9 too. @emaste, do you think the Foundation could sponsor this?
Now, as a Apache Shiro PMC, I would like to test against a FreeBSD build of OpenJ9 as well.
Most helpful comment
The FreeBSD issue was closed recently.