diff --git a/RISCV64.patch b/RISCV64.patch index 646493057e804b5ea479e3991e34026e0f6edd7d..087d25185f217e905bbe1f0863c880edbd1263aa 100644 --- a/RISCV64.patch +++ b/RISCV64.patch @@ -1,9 +1,9 @@ -diff -ruN a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 ---- a/common/autoconf/platform.m4 2023-04-18 17:53:02.000000000 -0400 -+++ b/common/autoconf/platform.m4 2025-04-28 04:39:06.796855081 -0400 -@@ -96,6 +96,18 @@ +diff -ru a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 +--- a/common/autoconf/platform.m4 2025-10-17 18:09:02.000000000 -0400 ++++ b/common/autoconf/platform.m4 2025-12-09 21:28:15.378058072 -0500 +@@ -102,6 +102,18 @@ VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big + VAR_CPU_ENDIAN=little ;; + riscv32) + VAR_CPU=riscv32 @@ -20,53 +20,52 @@ diff -ruN a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 *) AC_MSG_ERROR([unsupported cpu $1]) ;; -diff -ruN a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make ---- a/hotspot/make/linux/makefiles/gcc.make 2023-04-18 17:53:03.000000000 -0400 -+++ b/hotspot/make/linux/makefiles/gcc.make 2025-04-28 04:39:06.806855134 -0400 +diff -ru a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make +--- a/hotspot/make/linux/makefiles/gcc.make 2025-10-17 18:09:02.000000000 -0400 ++++ b/hotspot/make/linux/makefiles/gcc.make 2025-12-09 21:28:59.102057125 -0500 @@ -179,6 +179,7 @@ ARCHFLAG/sparcv9 = -m64 -mcpu=v9 ARCHFLAG/zero = $(ZERO_ARCHFLAG) ARCHFLAG/ppc64 = -m64 -+ARCHFLAG/riscv64 = ++ARCHFLAG/riscv64 = CFLAGS += $(ARCHFLAG) AOUT_FLAGS += $(ARCHFLAG) -diff -ruN a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp ---- a/hotspot/src/os/linux/vm/os_linux.cpp 2023-04-18 17:53:03.000000000 -0400 -+++ b/hotspot/src/os/linux/vm/os_linux.cpp 2025-04-28 04:39:06.806855134 -0400 -@@ -1950,6 +1950,10 @@ - #define EM_AARCH64 183 /* ARM AARCH64 */ +diff -ru a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp +--- a/hotspot/src/os/linux/vm/os_linux.cpp 2025-10-17 18:09:02.000000000 -0400 ++++ b/hotspot/src/os/linux/vm/os_linux.cpp 2025-12-09 21:32:24.690046547 -0500 +@@ -1952,6 +1952,9 @@ + #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"}, - {EM_486, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, -@@ -1972,6 +1976,7 @@ - {EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"}, +@@ -1976,6 +1979,7 @@ {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, ELFCLASSNONE, ELFDATA2MSB, (char*)"RISC-V"}, }; #if (defined IA32) -@@ -2004,9 +2009,11 @@ - static Elf32_Half running_arch_code=EM_68K; - #elif (defined AARCH64) +@@ -2010,9 +2014,11 @@ 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 -+ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, __riscv +- 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 -@@ -2039,10 +2046,12 @@ +@@ -2045,10 +2051,12 @@ } #ifndef S390 diff --git a/fix-build-against-GCC14.patch b/fix-build-against-GCC14.patch new file mode 100644 index 0000000000000000000000000000000000000000..28e5b346a0c4f75d35adadf43b3fa723f5878644 --- /dev/null +++ b/fix-build-against-GCC14.patch @@ -0,0 +1,49 @@ +diff -ru a/jdk/src/share/bin/splashscreen_stubs.c b/jdk/src/share/bin/splashscreen_stubs.c +--- a/jdk/src/share/bin/splashscreen_stubs.c 2025-10-17 18:09:02.000000000 -0400 ++++ b/jdk/src/share/bin/splashscreen_stubs.c 2025-12-10 10:39:39.988890135 -0500 +@@ -26,6 +26,10 @@ + #include + #include "splashscreen.h" + ++#if defined __GNUC__ && __GNUC__ >= 14 ++#pragma GCC diagnostic warning "-Wint-conversion" ++#endif ++ + extern void* SplashProcAddress(const char* name); /* in java_md.c */ + + /* +@@ -87,4 +91,4 @@ + char* DoSplashGetScaledImageName(const char* fileName, const char* jarName, + float* scaleFactor) { + INVOKE(SplashGetScaledImageName, NULL)(fileName, jarName, scaleFactor); +-} +\ No newline at end of file ++} +diff -ru a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c +--- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c 2025-10-17 18:09:02.000000000 -0400 ++++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c 2025-12-10 20:58:51.119883981 -0500 +@@ -53,6 +53,10 @@ + #include + #include "jerror.h" + ++#if defined __GNUC__ && __GNUC__ >= 14 ++#pragma GCC diagnostic warning "-Wincompatible-pointer-types" ++#endif ++ + #undef MAX + #define MAX(a,b) ((a) > (b) ? (a) : (b)) + +diff -ru a/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c b/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c +--- a/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c 2025-10-17 18:09:02.000000000 -0400 ++++ b/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c 2025-12-11 01:01:56.103579478 -0500 +@@ -37,6 +37,10 @@ + + #include "sun_nio_fs_LinuxNativeDispatcher.h" + ++#if defined __GNUC__ && __GNUC__ >= 14 ++#pragma GCC diagnostic warning "-Wimplicit-function-declaration" ++#endif ++ + typedef size_t fgetxattr_func(int fd, const char* name, void* value, size_t size); + typedef int fsetxattr_func(int fd, const char* name, void* value, size_t size, int flags); + typedef int fremovexattr_func(int fd, const char* name); diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index b00d9f971108b48c717b4af05343b159b8a47b22..6cc8e37c6eefff997b03bb5fbbb0aa87e42f17e0 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -13,7 +13,7 @@ # Only produce a release build on x86_64: # $ rhpkg mockbuild --without slowdebug --without fastdebug # -%global anolis_release 1 +%global anolis_release 2 # Enable fastdebug builds by default on relevant arches. %bcond_without fastdebug # Enable slowdebug builds by default on relevant arches. @@ -1423,6 +1423,7 @@ Patch2000: LoongArch64.patch ############################################# # Init support for riscv64 Patch3000: RISCV64.patch +Patch3001: fix-build-against-GCC14.patch ############################################# # @@ -1512,7 +1513,7 @@ BuildRequires: libstdc++-static # when it is built in debug-only this package is just placeholder %{java_rpo %{nil}} -ExclusiveArch: loongarch64 sw_64 +ExclusiveArch: loongarch64 sw_64 riscv64 %description The %{origin_nice} %{majorver} runtime environment. @@ -1814,7 +1815,7 @@ sh %{SOURCE12} %patch204 %endif -%ifnarch loongarch64 +%ifnarch loongarch64 riscv64 %patch1 %patch3 %patch5 @@ -1830,7 +1831,7 @@ sh %{SOURCE12} # AArch64 fixes # x86 fixes -%ifnarch loongarch64 +%ifnarch loongarch64 riscv64 %patch105 %endif @@ -1838,7 +1839,7 @@ sh %{SOURCE12} pushd %{top_level_dir_name} %patch502 -p1 popd -%ifnarch loongarch64 +%ifnarch loongarch64 riscv64 %patch512 %patch523 %patch528 @@ -1860,6 +1861,7 @@ pushd %{top_level_dir_name} %endif %ifarch riscv64 %patch3000 -p1 +%patch3001 -p1 %endif popd @@ -2666,6 +2668,9 @@ cjc.mainProgram(args) %endif %changelog +* Tue Dec 16 2025 Yihao Yan - 1:1.8.0.472.b08-2 +- enabled riscv64 + * Wed Nov 05 2025 panxuefeng - 1:1.8.0.472.b08-1 - update LoongArch64 port to 8u472