Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting BSD builds #3370

Open
bmarwell opened this issue Oct 19, 2018 · 10 comments
Open

Supporting BSD builds #3370

bmarwell opened this issue Oct 19, 2018 · 10 comments

Comments

@bmarwell
Copy link

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.

@pshipton
Copy link
Member

pshipton commented Oct 19, 2018

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.

@pshipton
Copy link
Member

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.

@pshipton
Copy link
Member

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.

@bmarwell
Copy link
Author

Thanks, I'll give you an update next week!

@bmarwell
Copy link
Author

bmarwell commented Oct 22, 2018

  • File ./jdk/make/closed/autoconf/generated-configure.sh also needs modification, in addidion to the custom-hook.m4 file.
  • Make did complain about missing zip binary. => pkg install zip
  • configure did complain about missing cups. => pkg install cups
  • Boot JDK is needed, I used openjdk via pkg. Note: openjdk is version 7.161.0.1, while jdk8 is named openjdk8 (and jdk6 is named openjdk6). Installation via ports would also be possible, I guess.
  • While clang seems to be installed, I had(?) to install gcc as well.
  • In ./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.
  • Edit ./workspace/config/built_config.cfg, set MAKE_COMMAND_NAME=gmake.
  • Edit ./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.

@dnakamura
Copy link
Contributor

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

@Thihup
Copy link
Contributor

Thihup commented Sep 28, 2020

Was there any progress?

@michael-o
Copy link

The FreeBSD issue was closed recently.

@michael-o
Copy link

michael-o commented Dec 24, 2020

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?

@pshipton pshipton added this to the Backlog milestone Dec 24, 2020
@bmarwell
Copy link
Author

Now, as a Apache Shiro PMC, I would like to test against a FreeBSD build of OpenJ9 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants