Skip to content

Commit

Permalink
updpatch: java8-openjdk 8.432.u05-1
Browse files Browse the repository at this point in the history
Fix rotten patches
  • Loading branch information
kxxt committed Nov 18, 2024
1 parent 175eac2 commit ad625c9
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 10 deletions.
116 changes: 116 additions & 0 deletions java8-openjdk/jdk8-riscv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
diff --git a/jdk8u-jdk8u432-b05.orig/common/autoconf/build-aux/autoconf-config.guess b/jdk8u-jdk8u432-b05/common/autoconf/build-aux/autoconf-config.guess
index 15ee438..c7355c3 100644
--- a/jdk8u-jdk8u432-b05.orig/common/autoconf/build-aux/autoconf-config.guess
+++ b/jdk8u-jdk8u432-b05/common/autoconf/build-aux/autoconf-config.guess
@@ -1000,6 +1000,9 @@ EOF
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
+ riscv64:Linux:*:*)
+ echo riscv64-unknown-linux-gnu
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
diff --git a/jdk8u-jdk8u432-b05.orig/common/autoconf/build-aux/autoconf-config.sub b/jdk8u-jdk8u432-b05/common/autoconf/build-aux/autoconf-config.sub
index 1aab2b3..662b002 100644
--- a/jdk8u-jdk8u432-b05.orig/common/autoconf/build-aux/autoconf-config.sub
+++ b/jdk8u-jdk8u432-b05/common/autoconf/build-aux/autoconf-config.sub
@@ -302,6 +302,7 @@ case $basic_machine in
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
+ | riscv32 | riscv64 \
| score \
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
@@ -383,6 +384,7 @@ case $basic_machine in
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
+ | riscv32-* | riscv64-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
diff --git a/jdk8u-jdk8u432-b05.orig/common/autoconf/platform.m4 b/jdk8u-jdk8u432-b05/common/autoconf/platform.m4
index f54942a..e70c159 100644
--- a/jdk8u-jdk8u432-b05.orig/common/autoconf/platform.m4
+++ b/jdk8u-jdk8u432-b05/common/autoconf/platform.m4
@@ -102,6 +102,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
VAR_CPU_BITS=64
VAR_CPU_ENDIAN=little
;;
+ riscv64)
+ VAR_CPU=riscv64
+ VAR_CPU_ARCH=riscv
+ VAR_CPU_BITS=64
+ VAR_CPU_ENDIAN=little
+ ;;
*)
AC_MSG_ERROR([unsupported cpu $1])
;;
@@ -387,6 +393,7 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
sparc*) ZERO_ARCHDEF=SPARC ;;
x86_64*) ZERO_ARCHDEF=AMD64 ;;
x86) ZERO_ARCHDEF=IA32 ;;
+ riscv*) ZERO_ARCHDEF=RISCV ;;
*) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z)
esac
AC_SUBST(ZERO_ARCHDEF)
diff --git a/jdk8u-jdk8u432-b05.orig/hotspot/src/os/linux/vm/os_linux.cpp b/jdk8u-jdk8u432-b05/hotspot/src/os/linux/vm/os_linux.cpp
index 5629a64..77fde84 100644
--- a/jdk8u-jdk8u432-b05.orig/hotspot/src/os/linux/vm/os_linux.cpp
+++ b/jdk8u-jdk8u432-b05/hotspot/src/os/linux/vm/os_linux.cpp
@@ -363,7 +363,7 @@ void os::init_system_properties_values() {
// 1: ...
// ...
// 7: The default directories, normally /lib and /usr/lib.
-#if defined(AMD64) || defined(_LP64) && (defined(SPARC) || defined(PPC) || defined(S390))
+#if defined(AMD64) || defined(_LP64) && (defined(SPARC) || defined(PPC) || defined(S390) || defined(RISCV))
#define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
#else
#define DEFAULT_LIBPATH "/lib:/usr/lib"
@@ -1952,6 +1952,9 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
#ifndef EM_LOONGARCH
#define EM_LOONGARCH 258 /* LoongArch */
#endif
+ #ifndef EM_RISCV
+ #define EM_RISCV 243 /* RISC-V */
+ #endif

static const arch_t arch_array[]={
{EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
@@ -1976,6 +1979,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
{EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"},
{EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"},
{EM_LOONGARCH, EM_LOONGARCH, ELFCLASS64, ELFDATA2LSB, (char*)"LoongArch"},
+ {EM_RISCV, EM_RISCV, ELFCLASS64, ELFDATA2LSB, (char*)"RISCV"},
};

#if (defined IA32)
@@ -2010,9 +2014,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
static Elf32_Half running_arch_code=EM_AARCH64;
#elif (defined LOONGARCH64)
static Elf32_Half running_arch_code=EM_LOONGARCH;
+ #elif (defined RISCV)
+ static Elf32_Half running_arch_code=EM_RISCV;
#else
#error Method os::dll_load requires that one of following is defined:\
- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH64
+ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH64, RISCV
#endif

// Identify compatability class for VM's architecture and library's architecture
@@ -2045,10 +2051,12 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
}

#ifndef S390
+#ifndef RISCV
if (lib_arch.elf_class != arch_array[running_arch_index].elf_class) {
::snprintf(diag_msg_buf, diag_msg_max_length-1," (Possible cause: architecture word width mismatch)");
return NULL;
}
+#endif // RISCV
#endif // !S390

if (lib_arch.compat_class != arch_array[running_arch_index].compat_class) {
20 changes: 10 additions & 10 deletions java8-openjdk/riscv64.patch
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
--- PKGBUILD
+++ PKGBUILD
@@ -38,6 +38,7 @@
@@ -41,6 +41,7 @@ b2sums=('78fdd9d59d9f9f5bf3d65901fa8cf44d42ffedf3bd48552575febeb3a35d24567b209e2
case "${CARCH}" in
'x86_64') _JARCH=amd64 ; _DOC_ARCH=x86_64 ;;
'i686' ) _JARCH=i386 ; _DOC_ARCH=x86 ;;
+ 'riscv64')_JARCH=riscv64;_DOC_ARCH=riscv64;;
esac

_jdkname=openjdk8
@@ -54,6 +55,10 @@
@@ -57,6 +58,10 @@ prepare() {

# Fix build with C++17 (Fedora)
patch -Np1 -i "${srcdir}"/gcc11.patch
+
+ # RISC-V Support
+ patch -Np1 -i "${srcdir}"/java8-openjdk-add-riscv-support.patch
+ patch -Np2 -i "${srcdir}"/jdk8-riscv.patch
+ (cd common/autoconf && bash ./autogen.sh)
}

build() {
@@ -79,7 +84,9 @@
--with-zlib=system \
@@ -83,7 +88,9 @@ build() {
--with-extra-cflags="${CFLAGS}" \
--with-extra-cxxflags="${CXXFLAGS}" \
- --with-extra-ldflags="${LDFLAGS}"
+ --with-extra-ldflags="${LDFLAGS}" \
--with-extra-ldflags="${LDFLAGS}" \
- --with-vendor-name="Arch Linux"
+ --with-vendor-name="Arch Linux" \
+ --with-jvm-variants=zero \
+ --disable-jfr

# These help to debug builds: LOG=trace HOTSPOT_BUILD_JOBS=1
# Without 'DEBUG_BINARIES', i686 won't build: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019203.html
@@ -275,8 +282,11 @@
@@ -279,8 +286,11 @@ package_openjdk8-doc() {
pkgdesc='OpenJDK Java 8 documentation'

install -d -m 755 "${pkgdir}/usr/share/doc/${pkgbase}/"
Expand All @@ -39,7 +39,7 @@
"${pkgdir}/usr/share/doc/${pkgbase}/"
}

+source+=(java8-openjdk-add-riscv-support.patch::https://gitee.com/misaka00251/openjdk-1.8.0/raw/e4b9d135939e2263146905911ad100424101e305/add-riscv-support.patch)
+b2sums+=('86cd7d1079944b29441227da00df2c4ee45ccf6c95a5c20eb9cc5e9d02e9fa6b6c8d26f69216b42d8e7832ad0f592a689464521765622f9355f4184ff87b6f06')
+source+=(jdk8-riscv.patch)
+b2sums+=('f4b11b447bc36cdd26d2b157d7c6c2311e5b98fcae0c9e8d0507345c31a8a8f20c6c2af356ae87594e4d37fd5e7ba9d93441f273ca0578132c7ffb24a9b983f9')
+
# vim: ts=2 sw=2 et:

0 comments on commit ad625c9

Please sign in to comment.