Created attachment 205978 [details]
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]
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:
The cause is one of updates to hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp. I'll try to bisect.
Created attachment 205995 [details]
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:
Date: Wed Jul 24 23:29:40 UTC 2019
New revision: 507305
Fix the build for powerpc64
Submitted by: pkubaj
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.