Created attachment 203773 [details] Patch to add powerpc64 support Adds powerpc64 support. Uses bootstrap provided by https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237208
@Curtis If bug 237208 needs to land before this can, please add it to the 'Depends on' field
(In reply to Kubilay Kocak from comment #1) Doesn't need bug 237208 to land, but uses the provided bootstrap. http://mikael.urankar.free.fr/FreeBSD/powerpc64/bootstrap-openjdk11-powerpc64-11.0.2.9.2.tar.xz
I'd prefer that instead of committing this directly to the FreeBSD port that we instead work this out on Github in the upstream repo. I'm very open to a pull request there and have one from Mikael for openjdk11. If you'd like to contribute to that or open a separate one for openjdk12 I'd be happy to merge it in and cut a release. See https://github.com/battleblow/openjdk-jdk11u/pull/13 for the openjdk11 pull request. I've asked for a few changes before merging it.
Hi folks, Shouldn't we contribute to the OpenJDK upstream project?
(In reply to Gustavo Romero from comment #4) Contribute Curti's patchset to OpenJDK tip then request a downport to 11 LTS I mean.
I'll submit a pull request. However, the GitHub repo seems to be missing "src/jdk.hotspot.agent/bsd/native/libsaproc" directory and files.
Thanks. Please check the bsd-port branch. That has all the changes for *BSD. The master branch just tracks the upstream master.
Which is to say that you'll find that directory if you switch to the bsd-port branch.
Greg, maybe I'm looking in the wrong place (http://hg.openjdk.java.net/bsd-port), but I don't see jdk11 nor jdk12. Nor do I see the bsd files in http://hg.openjdk.java.net/jdk-updates Perhaps you can point me to the correct repo.
it's here https://github.com/battleblow/openjdk-jdk12u git clone -b bsd-port https://github.com/battleblow/openjdk-jdk12u.git
Pull request submitted.
Hi, Curtis, I believe Greg e Mikael are talking only about OpenJDK code in FreeBSD port github (downstream) whilst I'm talking about the OpenJDK Mercurial repo in openjdk.java.net in fact (upstream) and trying to understand if you are planning to contribute the patcheset to that upstream OpenJDK repo (bsd port in Hg openjdk.java.net). It looks like that the OpenJDK PPC64 BSD port effort/discussions upstream got stuck as per bsd port ML [0] (looks only a bunch of advertisement for last non-related pushes to jdk8u) and from what I remember from the last discussions more than a year ago on ppc-aix-port ML [1]. Hence I'm wondering what's your current understanding about it/plans, Curtis :) Thank you. [0] https://mail.openjdk.java.net/pipermail/bsd-port-dev/ [1] https://mail.openjdk.java.net/pipermail/ppc-aix-port-dev/2016-December/002847.html
(In reply to Gustavo Romero from comment #12) Understood! My initial efforts back in 2016 were to provide the patches directly to openjdk.java.net. I may have even exchanged emails with you about including my patched in the ppc-aix-port back then. However, it was recommended that I provide my patches to the downstream bsd-port. So I worked with Greg to get the initial jdk8 patches committed. Greg and the maintainers of the bsd-port should decide whether to upstream the bsd-port (patches) to openjdk.java.net. These patches alone are incomplete. Hope this helps.
(In reply to Curtis Hamilton from comment #13) Got it, Curtis. It does help me to understand the current situation. Thank you!
Just to confirm we're good to go, can someone please try a build of the bsd-port branch of https://github.com/battleblow/openjdk-jdk12u on powerpc64? If that looks good then I'll make a release.
In terms of where to upstream patches, it would likely take a dedicated developer several months to coordinate getting patches upstreamed to the Mercurial repository. No one has stepped forward with that sort of time over the last few years since Java 8. I've also noticed that it seems to limit collaboration since people have to sign an Oracle Contributor Agreement for us to upstream their patches and not as many people are familiar with Mercurial as they are Git. The interface doesn't provide the same tooling that a site like Github does as well to enable easy forking and pull requests. This has led to a lot of patches existing only in the FreeBSD port that were generally applicable. For Java 11 I decided to try following the AdoptOpenJDK ports on Github. So far this has been positive in terms of collaboration and ease of releases/port updates, at least from my perspective. Ideally we'd still look to upstream these changes, but that will ultimately still require someone dedicated to doing so with sufficient time to make it happen.
Tried a build of this on PPC (PowerMac), using the same build commands as with openjdk11 from the other bug. Pulled the latest from the bsd-port branch. I had to remove --with-milestone=fcs \ when running the configure as it says: configure: error: unrecognized options: --with-milestone Removing that I can start the compile, but get errors: === Output from failing command(s) repeated here === /usr/bin/printf "* For target hotspot_variant-server_libjvm_objs_classFileParser.o:\n" * For target hotspot_variant-server_libjvm_objs_classFileParser.o: (/usr/bin/grep -v -e "^Note: including file:" < /root/jdk/openjdk-jdk12u/build/bsd-ppc64-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_classFileParser.o.log || true) | /usr/bin/head -n 12 /root/jdk/openjdk-jdk12u/src/hotspot/share/classfile/classFileParser.cpp: In member function 'void ClassFileParser::prepend_host_package_name(const InstanceKlass*, Thread*)': /root/jdk/openjdk-jdk12u/src/hotspot/share/classfile/classFileParser.cpp:5761:12: error: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] strncpy(new_anon_name, host_pkg_name, host_pkg_len); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /root/jdk/openjdk-jdk12u/src/hotspot/share/classfile/classFileParser.cpp:5756:33: note: length computed here size_t host_pkg_len = strlen(host_pkg_name); ~~~~~~^~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors if test `/usr/bin/wc -l < /root/jdk/openjdk-jdk12u/build/bsd-ppc64-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_classFileParser.o.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi /usr/bin/printf "* For target hotspot_variant-server_libjvm_objs_classLoaderExt.o:\n" * For target hotspot_variant-server_libjvm_objs_classLoaderExt.o: (/usr/bin/grep -v -e "^Note: including file:" < /root/jdk/openjdk-jdk12u/build/bsd-ppc64-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_classLoaderExt.o.log || true) | /usr/bin/head -n 12 /root/jdk/openjdk-jdk12u/src/hotspot/share/classfile/classLoaderExt.cpp: In static member function 'static void ClassLoaderExt::process_jar_manifest(ClassPathEntry*, bool)': /root/jdk/openjdk-jdk12u/src/hotspot/share/classfile/classLoaderExt.cpp:212:16: error: 'char* strncat(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] strncat(libname, file_start, name_len); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /root/jdk/openjdk-jdk12u/src/hotspot/share/classfile/classLoaderExt.cpp:206:33: note: length computed here int name_len = (int)strlen(file_start); ~~~~~~^~~~~~~~~~~~ cc1plus: all warnings being treated as errors if test `/usr/bin/wc -l < /root/jdk/openjdk-jdk12u/build/bsd-ppc64-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_classLoaderExt.o.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi /usr/bin/printf "\n* All command lines available in /root/jdk/openjdk-jdk12u/build/bsd-ppc64-server-release/make-support/failure-logs.\n"
(In reply to Francis Little from comment #17) Ensure you configure with "--disable-warnings-as-errors", otherwise you'll encounter the string errors with gcc.
(In reply to Curtis Hamilton from comment #18) Hi, I get the following about missing alloca.h: === Output from failing command(s) repeated here === /usr/bin/printf "* For target hotspot_variant-server_libjvm_objs_sharedRuntime_ppc.o:\n" * For target hotspot_variant-server_libjvm_objs_sharedRuntime_ppc.o: (/usr/bin/grep -v -e "^Note: including file:" < /root/jdk/openjdk-jdk12u/build/bsd-ppc64-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_sharedRuntime_ppc.o.log || true) | /usr/bin/head -n 12 /root/jdk/openjdk-jdk12u/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp:50:10: fatal error: alloca.h: No such file or directory #include <alloca.h> ^~~~~~~~~~ compilation terminated.
(In reply to Francis Little from comment #19) So it looks like there is a fix in the above patch, is that to apply after the pull from the git repo or should it already be in there?
(In reply to Francis Little from comment #20) I just took a look at the repo and found 2 patches that seems to have been dropped for "src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp" and "src/hotspot/cpu/ppc/vm_version_ppc.cpp". Just submitted a new PR to fix.
I've merged the missing change from the openjdk11 repo.
(In reply to Greg Lewis from comment #22) Thanks Greg.
Hi, the build has completed using the following: env CC=/usr/local/bin/gcc8 \ CXX=/usr/local/bin/g++8 \ bash configure \ --with-boot-jdk=/usr/local/openjdk11 \ --disable-ccache \ --disable-hotspot-gtest \ --disable-dtrace \ --disable-warnings-as-errors \ --with-alsa=/usr/local \ --with-cups=/usr/local \ --with-fontconfig=/usr/local \ --with-freetype=system \ --with-freetype-include=/usr/local/include/freetype2 \ --with-freetype-lib=/usr/local/lib \ --with-libjpeg=system \ --with-giflib=system \ --with-giflib-include=/usr/local/include \ --with-giflib-lib=/usr/local/lib \ --with-libpng=system \ --with-zlib=system \ --with-lcms=system \ --with-toolchain-type=gcc \ --x-includes=/usr/local/include \ --x-libraries=/usr/local/lib \ --with-debug-level=release env LANG="C" \ LC_ALL="C" \ CLASSPATH="" \ JAVA_HOME="" \ LD_LIBRARY_PATH="" \ CC=/usr/local/bin/gcc8 \ CXX=/usr/local/bin/g++8 \ MAKEFLAGS="" \ gmake \ CC=/usr/local/bin/gcc8 \ CXX=/usr/local/bin/g++8 \ COMPILER_WARNINGS_FATAL="false" \ LOG=debug \ images root@PowerMacG5:~/jdk/openjdk-jdk12u # ./build/bsd-ppc64-server-release/jdk/bin/java --version openjdk 12.0.1-internal 2019-04-16 OpenJDK Runtime Environment (build 12.0.1-internal+0-adhoc.root.openjdk-jdk12u) OpenJDK 64-Bit Server VM (build 12.0.1-internal+0-adhoc.root.openjdk-jdk12u, mixed mode) root@PowerMacG5:~/jdk/openjdk-jdk12u # ./build/bsd-ppc64-server-release/jdk/bin/javac --version javac 12.0.1-internal
A commit references this bug: Author: glewis Date: Fri May 17 04:32:41 UTC 2019 New revision: 501835 URL: https://svnweb.freebsd.org/changeset/ports/501835 Log: Update to 12.0.1.12.2 which includes powerpc64 support. PR: 237370 Changes: head/java/openjdk12/Makefile head/java/openjdk12/distinfo
A commit references this bug: Author: glewis Date: Sun Aug 25 20:55:20 UTC 2019 New revision: 509856 URL: https://svnweb.freebsd.org/changeset/ports/509856 Log: Allow the JDK to be compiled with gcc. This is required for powerpc64 support. PR: 237370 Changes: head/java/openjdk12/Makefile
A commit references this bug: Author: glewis Date: Mon Aug 26 02:00:43 UTC 2019 New revision: 509861 URL: https://svnweb.freebsd.org/changeset/ports/509861 Log: Add powerpc64 support PR: 237370 Changes: head/java/openjdk12/Makefile head/java/openjdk12/files/patch-src_jdk.hotspot.agent_bsd_native_libsaproc_ps__proc.c