java/openjdk11: fix build on 32 bit arm

Slightly adjusted the patch of Mikael Urankar to make sure it only
affects __arm__ builds.
The patch is similar to what fixed openjdk8 in
commit e13c811372.

Not bumping portrevision as nothing changes for existing pkgs.

PR:	255662
Approved by:	java@ (maintainer timeout)
This commit is contained in:
MikaelUrankar
2024-10-10 17:10:33 +02:00
committed by Ronald Klop
parent 77d61ade3f
commit b42fb59dbc
3 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
--- make/hotspot/lib/CompileJvm.gmk.orig 2024-10-04 16:07:55.502680000 +0200
+++ make/hotspot/lib/CompileJvm.gmk 2024-10-04 16:07:03.672629000 +0200
@@ -109,7 +109,7 @@ ifeq ($(call And, $(call isTargetOs, linux) $(call isT
ifeq ($(call And, $(call isTargetOs, linux) $(call isTargetCpu, arm)), true)
JVM_EXCLUDE_PATTERNS += arm_64
-else ifeq ($(call And, $(call isTargetOs, bsd) $(call isTargetCpu, bsd-arm)), true)
+else ifeq ($(call And, $(call isTargetOs, bsd) $(call isTargetCpu, arm)), true)
JVM_EXCLUDE_PATTERNS += arm_64
else ifeq ($(call And, $(call isTargetOs, linux) $(call isTargetCpu, aarch64)), true)

View File

@@ -0,0 +1,30 @@
This patch fixes the following error:
In file included from jdk11u-jdk-11.0.24-8-1/src/hotspot/os/bsd/os_perf_bsd.cpp:47:
In file included from /usr/include/sys/user.h:51:
In file included from /usr/include/vm/pmap.h:88:
In file included from /usr/include/machine/pmap.h:48:
In file included from /usr/include/sys/systm.h:46:
/usr/include/machine/cpufunc.h:185:1: error: static declaration of 'breakpoint' follows non-static declaration
185 | breakpoint(void)
| ^
/usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/hotspot/share/utilities/breakpoint.hpp:31:17: note: previous declaration is here
31 | extern "C" void breakpoint();
--- src/hotspot/os/bsd/os_perf_bsd.cpp.orig 2024-11-08 11:24:38 UTC
+++ src/hotspot/os/bsd/os_perf_bsd.cpp
@@ -43,6 +43,12 @@
* with the same name.
*/
#define _MACHINE_PCB_H_
+ /*
+ * do not redefine breakpoint on armv7
+ */
+ #ifdef __arm__
+ #define _MACHINE_CPUFUNC_H_
+ #endif
#endif
#include <sys/user.h>
#endif

View File

@@ -0,0 +1,25 @@
This patch fixes the following error:
In file included from /usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/jdk.hotspot.agent/bsd/native/libsaproc/ps_proc.c:40:
In file included from /usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/jdk.hotspot.agent/bsd/native/libsaproc/libproc_impl.h:30:
/usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/jdk.hotspot.agent/bsd/native/libsaproc/libproc.h:79:13: error: cannot combine with previous 'int' declaration specifier
79 | typedef int bool;
| ^
/usr/include/stdbool.h:37:14: note: expanded from macro 'bool'
37 | #define bool _Bool
--- src/jdk.hotspot.agent/bsd/native/libsaproc/libproc.h.orig 2024-10-07 16:02:52.117023000 +0200
+++ src/jdk.hotspot.agent/bsd/native/libsaproc/libproc.h 2024-10-07 16:02:15.020023000 +0200
@@ -76,9 +76,11 @@ typedef int bool;
// This C bool type must be int for compatibility with BSD calls and
// it would be a mistake to equivalence it to C++ bool on many platforms
+#if defined(__FreeBSD__) && defined(__arm__) && !defined(__bool_true_false_are_defined)
typedef int bool;
#define true 1
#define false 0
+#endif // __FreeBSD__ && __arm__ && !__bool_true_false_are_defined
#endif // __APPLE__