Created attachment 205978 [details] patch In hotspot/agent/src/os/bsd/ps_proc.c move include sys/sysctl.h after include sys/types.h. Otherwise build fails with: /usr/include/sys/sysctl.h:1062: error: expected declaration specifiers or '...' before 'u_int'
Created attachment 205986 [details] fail log It looks like even though openjdk8 itself builds with this patch, ports using java now fail to build, e.g. graphics/batik: # # A fatal error has been detected by the Java Runtime Environment: # # SIGILL (0x4) at pc=0x000000081224b41c, pid=78786, tid=0x0000000000018962 # # JRE version: OpenJDK Runtime Environment (8.0_222-b10) (build 1.8.0_222-b10) # Java VM: OpenJDK 64-Bit Server VM (25.222-b10 mixed mode bsd-ppc64 compressed oops) # Problematic frame: # v ~StubRoutines::jlong_disjoint_arraycopy # # Core dump written. Default location: /usr/local/poudriere/ports/default/graphics/batik/work/batik-1.7/java.core # # An error report file with more information is saved as: # /usr/local/poudriere/ports/default/graphics/batik/work/batik-1.7/hs_err_pid78786.log
The cause is one of updates to hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp. I'll try to bisect.
Created attachment 205995 [details] v2 This patch fixes things on powerpc64. Note that files/patch-hotspot_src_cpu_ppc_vm_stubGenerator__ppc.cpp should only be necessary on 11 and 12 (stable/12 should have fix for mfdscr issue in near future).
A commit references this bug: Author: glewis Date: Wed Jul 24 23:29:40 UTC 2019 New revision: 507305 URL: https://svnweb.freebsd.org/changeset/ports/507305 Log: Fix the build for powerpc64 PR: 239368 Submitted by: pkubaj Changes: head/java/openjdk8/files/patch-hotspot_agent_src_os_bsd_ps__proc.c head/java/openjdk8/files/patch-hotspot_src_cpu_ppc_vm_stubGenerator__ppc.cpp
I have upstreamed the change to ps_proc.c. I've concerns about the patch to stubGenerator_ppc.cpp though in that it deletes code which other OSes may be using. Would it work if we instead just set has_mfdscr() to return false on FreeBSD?
(In reply to Greg Lewis from comment #5) The change to stubGenerator_ppc.cpp is because of a bug in stable/12 (and it apparently won't be fixed in 12 because of KBI breakage by the fix). It's already fixed in head. 11 also has this bug, but POWER processors that support mfdscr don't work in 11 (only since 12). So this bug really applies only to 12. You could set has_mfdscr() to false, but only on FreeBSD 12.
(In reply to Greg Lewis from comment #5) Since new OpenJDK doesn't build on stable/12, can you make has_mfdscr() return false on 12? OpenJDK8 builds, the problem is with 11 and 12 (and probably 13).
I am looking at that and also at rebuilding the bootstrap for openjdk11 since it is causing issues on 12.x as well.
Created attachment 208537 [details] Disable mfdscr on FreeBSD 12 for openjdk11
I don't have a powerpc64 12.x box at the moment. Piotr, can you give the patch I just attached a test compile if you do? I'll work on building the bootstrap with that applied as well. Particularly interested on testing this on a POWER8 or higher to see if it has the desired effect.
The bootstrap at http://distcache.freebsd.org/local-distfiles/glewis/bootstrap-openjdk11/bootstrap-openjdk11-powerpc64-11.0.5.tar.xz may also be necessary to compile openjdk11 on POWER8+. Note that URL is certainly temporary. Once I've got some confirmation that we have a working set up I'll get the port ready to go.
(In reply to Greg Lewis from comment #10) > I don't have a powerpc64 12.x box at the moment. Piotr, can you give the patch > I just attached a test compile if you do? I do not have access to a 12.x box either but I can confirm it "does no harm" on 13-CURRENT.
(In reply to Mark Linimon from comment #12) Thanks Mark, that's a useful data point. Just need to hear from someone with a 12.x POWER8+ box then.
A commit references this bug: Author: glewis Date: Wed Nov 6 17:19:31 UTC 2019 New revision: 516905 URL: https://svnweb.freebsd.org/changeset/ports/516905 Log: Update bootstrap for openjdk11 * Re-roll bootstrap binaries. The main reason for this is that the previous binaries won't work correctly on a FreeBSD 12/powerpc64 POWER8+ machine. PR: 239368 Changes: head/java/bootstrap-openjdk11/Makefile head/java/bootstrap-openjdk11/distinfo head/java/bootstrap-openjdk11/pkg-message head/java/bootstrap-openjdk11/pkg-plist
A commit references this bug: Author: glewis Date: Wed Nov 6 17:21:59 UTC 2019 New revision: 516906 URL: https://svnweb.freebsd.org/changeset/ports/516906 Log: Fix build on FreeBSD 12.x/powerpc64 on POWER8+ machines * Make sure has_mfdscr() returns false on these machines as using it on FreeBSD 12.x will cause problems (e.g. SIGILL). PR: 239368 Changes: head/java/openjdk11/Makefile head/java/openjdk11/files/extra-patch-src_hotspot_cpu_ppc_vm__version__ppc.hpp
A commit references this bug: Author: glewis Date: Wed Nov 6 17:31:34 UTC 2019 New revision: 516907 URL: https://svnweb.freebsd.org/changeset/ports/516907 Log: Fix build on FreeBSD 12.x/powerpc64 on POWER8+ machines * Make sure has_mfdscr() returns false on these machines as using it on FreeBSD 12.x will cause problems (e.g. SIGILL). PR: 239368 Sponsored by: The FreeBSD Foundation Changes: head/java/openjdk12/Makefile head/java/openjdk12/files/extra-patch-src_hotspot_cpu_ppc_vm__version__ppc.hpp
A commit references this bug: Author: glewis Date: Wed Nov 6 17:35:05 UTC 2019 New revision: 516908 URL: https://svnweb.freebsd.org/changeset/ports/516908 Log: Fix build on FreeBSD 12.x/powerpc64 on POWER8+ machines * Make sure has_mfdscr() returns false on these machines as using it on FreeBSD 12.x will cause problems (e.g. SIGILL). PR: 239368 Sponsored by: The FreeBSD Foundation Changes: head/java/openjdk13/Makefile head/java/openjdk13/files/extra-patch-src_hotspot_cpu_ppc_vm__version__ppc.hpp
The latest commits should fix this for all remaining versions of jdk