java/openjdk11: add powerpc64le support

This mostly adds powerpc64le in places where there's only powerpc64.

PR:		251263
Approved by:	java (maintainer timeout)
This commit is contained in:
Piotr Kubaj
2020-12-03 23:46:20 +00:00
parent 138911b294
commit 89480f7d7e
5 changed files with 58 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ COMMENT?= Java Development Kit ${JDK_MAJOR_VERSION}
LICENSE= GPLv2
ONLY_FOR_ARCHS= amd64 i386 powerpc64
ONLY_FOR_ARCHS= amd64 i386 powerpc64 powerpc64le
BUILD_DEPENDS= zip:archivers/zip \
autoconf>0:devel/autoconf \
@@ -147,11 +147,11 @@ CONFIGURE_ARGS+= --with-extra-ldflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFA
MAKE_ENV+= USE_CLANG=true
.endif
.if ${ARCH} == aarch64 || ${ARCH} == powerpc64
.if ${ARCH} == aarch64 || ${ARCH:Mpowerpc64*}
CONFIGURE_ARGS+= --disable-warnings-as-errors \
--disable-dtrace
.endif
.if defined(PPC_ABI) && ${PPC_ABI} == ELFv2
.if (defined(PPC_ABI) && ${PPC_ABI} == ELFv2) || ${ARCH} == powerpc64le
CONFIGURE_ARGS+= --disable-precompiled-headers
.endif
.if ${ARCH} != amd64

View File

@@ -1,12 +1,16 @@
--- make/autoconf/flags-cflags.m4.orig 2020-01-08 09:12:31 UTC
+++ make/autoconf/flags-cflags.m4
@@ -770,6 +770,10 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
@@ -770,6 +770,14 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
# for all archs except arm and ppc, prevent gcc to omit frame pointer
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
fi
+ elif test "x$OPENJDK_TARGET_OS_ENV" = xbsd.freebsd; then
+ if test "x$FLAGS_CPU" = xppc64; then
+ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=powerpc64 -mtune=power5"
+ elif test "x$FLAGS_CPU" = xppc64le; then
+ # Little endian machine uses ELFv2 ABI.
+ # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
+ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8"
+ fi
fi

View File

@@ -0,0 +1,20 @@
--- src/hotspot/os_cpu/bsd_ppc/bytes_bsd_ppc.inline.hpp.orig 2020-11-19 20:56:24 UTC
+++ src/hotspot/os_cpu/bsd_ppc/bytes_bsd_ppc.inline.hpp
@@ -27,13 +27,13 @@
#define OS_CPU_BSD_PPC_VM_BYTES_BSD_PPC_INLINE_HPP
#if defined(VM_LITTLE_ENDIAN)
-#include <byteswap.h>
+#include <sys/endian.h>
// Efficient swapping of data bytes from Java byte
// ordering to native byte ordering and vice versa.
-inline u2 Bytes::swap_u2(u2 x) { return bswap_16(x); }
-inline u4 Bytes::swap_u4(u4 x) { return bswap_32(x); }
-inline u8 Bytes::swap_u8(u8 x) { return bswap_64(x); }
+inline u2 Bytes::swap_u2(u2 x) { return bswap16(x); }
+inline u4 Bytes::swap_u4(u4 x) { return bswap32(x); }
+inline u8 Bytes::swap_u8(u8 x) { return bswap64(x); }
#endif // VM_LITTLE_ENDIAN
#endif // OS_CPU_BSD_PPC_VM_BYTES_BSD_PPC_INLINE_HPP

View File

@@ -0,0 +1,20 @@
--- src/jdk.hotspot.agent/bsd/native/libsaproc/BsdDebuggerLocal.c.orig 2020-11-19 21:24:03 UTC
+++ src/jdk.hotspot.agent/bsd/native/libsaproc/BsdDebuggerLocal.c
@@ -42,7 +42,7 @@
#include "sun_jvm_hotspot_debugger_sparc_SPARCThreadContext.h"
#endif
-#ifdef ppc64
+#if defined(ppc64) || defined(ppc64le)
#include "sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext.h"
#endif
@@ -373,7 +373,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debu
#if defined(sparc) || defined(sparcv9)
#define NPRGREG sun_jvm_hotspot_debugger_sparc_SPARCThreadContext_NPRGREG
#endif
-#ifdef ppc64
+#if defined(ppc64) || defined(ppc64le)
#define NPRGREG sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext_NPRGREG
#endif
#ifdef aarch64

View File

@@ -0,0 +1,10 @@
--- src/utils/hsdis/Makefile.orig 2020-11-19 21:27:40 UTC
+++ src/utils/hsdis/Makefile
@@ -143,6 +143,7 @@ ifdef LP64
CFLAGS/sparcv9 += -m64
CFLAGS/amd64 += -m64
CFLAGS/ppc64 += -m64
+CFLAGS/ppc64le += -m64 -DABI_ELFv2
else # LP64
ARCH=$(ARCH2:amd64=i386)
ifneq ($(findstring arm,$(ARCH)),)