Fix build on riscv64 in prep stage

This commit is contained in:
Kun Wang 2024-05-24 11:17:41 +08:00
parent 32764f43b8
commit 212bb5ae96
3 changed files with 6505 additions and 5132 deletions

File diff suppressed because one or more lines are too long

View File

@ -33,12 +33,12 @@ index 1aab2b30..662b002a 100644
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4
index 51df988f..1cce0e4f 100644 index f54942ac..790e28aa 100644
--- a/common/autoconf/platform.m4 --- a/common/autoconf/platform.m4
+++ b/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4
@@ -96,6 +96,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], @@ -102,6 +102,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
VAR_CPU_BITS=64 VAR_CPU_BITS=64
VAR_CPU_ENDIAN=big VAR_CPU_ENDIAN=little
;; ;;
+ riscv64) + riscv64)
+ VAR_CPU=riscv64 + VAR_CPU=riscv64
@ -49,19 +49,19 @@ index 51df988f..1cce0e4f 100644
*) *)
AC_MSG_ERROR([unsupported cpu $1]) AC_MSG_ERROR([unsupported cpu $1])
;; ;;
@@ -381,6 +387,7 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], @@ -387,6 +393,7 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
sparc*) ZERO_ARCHDEF=SPARC ;; sparc*) ZERO_ARCHDEF=SPARC ;;
x86_64*) ZERO_ARCHDEF=AMD64 ;; x86_64*) ZERO_ARCHDEF=AMD64 ;;
x86) ZERO_ARCHDEF=IA32 ;; x86) ZERO_ARCHDEF=IA32 ;;
+ riscv*) ZERO_ARCHDEF=RISCV ;; + riscv*) ZERO_ARCHDEF=RISCV ;;
*) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z) *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z)
esac esac
AC_SUBST(ZERO_ARCHDEF) AC_SUBST(ZERO_ARCHDEF)
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
index 2d3880b3..6ec35ec1 100644 index 54cfcdd1..88eb8acd 100644
--- a/hotspot/src/os/linux/vm/os_linux.cpp --- a/hotspot/src/os/linux/vm/os_linux.cpp
+++ b/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp
@@ -367,7 +367,7 @@ void os::init_system_properties_values() { @@ -363,7 +363,7 @@ void os::init_system_properties_values() {
// 1: ... // 1: ...
// ... // ...
// 7: The default directories, normally /lib and /usr/lib. // 7: The default directories, normally /lib and /usr/lib.
@ -70,38 +70,38 @@ index 2d3880b3..6ec35ec1 100644
#define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib" #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
#else #else
#define DEFAULT_LIBPATH "/lib:/usr/lib" #define DEFAULT_LIBPATH "/lib:/usr/lib"
@@ -1953,6 +1953,9 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) @@ -1949,6 +1949,9 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
#ifndef EM_AARCH64 #ifndef EM_AARCH64
#define EM_AARCH64 183 /* ARM AARCH64 */ #define EM_AARCH64 183 /* ARM AARCH64 */
#endif #endif
+ #ifndef EM_RISCV + #ifndef EM_RISCV
+ #define EM_RISCV 243 /* RISC-V */ + #define EM_RISCV 243 /* RISC-V */
+ #endif + #endif
#ifndef EM_LOONGARCH
static const arch_t arch_array[]={ #define EM_LOONGARCH 258 /* LoongArch */
{EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, #endif
@@ -1976,6 +1979,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) @@ -1976,6 +1979,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
{EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"},
{EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"}, {EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"},
{EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"}, {EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"},
{EM_LOONGARCH, EM_LOONGARCH, ELFCLASS64, ELFDATA2LSB, (char*)"LoongArch"},
+ {EM_RISCV, EM_RISCV, ELFCLASSNONE, ELFDATA2MSB, (char*)"RISCV"}, + {EM_RISCV, EM_RISCV, ELFCLASSNONE, ELFDATA2MSB, (char*)"RISCV"},
}; };
#if (defined IA32) #if (defined IA32)
@@ -2008,9 +2012,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) @@ -2010,9 +2014,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
static Elf32_Half running_arch_code=EM_68K;
#elif (defined AARCH64)
static Elf32_Half running_arch_code=EM_AARCH64; static Elf32_Half running_arch_code=EM_AARCH64;
#elif (defined LOONGARCH)
static Elf32_Half running_arch_code=EM_LOONGARCH;
+ #elif (defined RISCV) + #elif (defined RISCV)
+ static Elf32_Half running_arch_code=EM_RISCV; + static Elf32_Half running_arch_code=EM_RISCV;
#else #else
#error Method os::dll_load requires that one of following is defined:\ #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, LOONGARCH
+ 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, LOONGARCH, RISCV
#endif #endif
// Identify compatability class for VM's architecture and library's architecture // Identify compatability class for VM's architecture and library's architecture
@@ -2043,10 +2049,12 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) @@ -2045,10 +2051,12 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
} }
#ifndef S390 #ifndef S390
@ -114,5 +114,3 @@ index 2d3880b3..6ec35ec1 100644
#endif // !S390 #endif // !S390
if (lib_arch.compat_class != arch_array[running_arch_index].compat_class) { if (lib_arch.compat_class != arch_array[running_arch_index].compat_class) {
--
2.17.1

View File

@ -936,7 +936,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r
Name: java-%{javaver}-%{origin} Name: java-%{javaver}-%{origin}
Version: %{javaver}.%{updatever}.%{buildver} Version: %{javaver}.%{updatever}.%{buildver}
Release: 3 Release: 5
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
# and this change was brought into RHEL-4. java-1.5.0-ibm packages # and this change was brought into RHEL-4. java-1.5.0-ibm packages
# also included the epoch in their virtual provides. This created a # also included the epoch in their virtual provides. This created a
@ -2624,6 +2624,13 @@ cjc.mainProgram(arg)
%endif %endif
%changelog %changelog
* Thu May 23 2024 Dingli Zhang <dingli@iscas.ac.cn> -1:1.8.0.412-b08.5
- Fix build on riscv64 in prep stage
* Wed May 15 2024 songliyang <songliyang@kylinos.cn> -1:1.8.0.412-b08.4
- fix LoongArch64-support.patch error that apply patch on loongarch64 in prep stage
- fix loongson vendor error
* Tue May 7 2024 kuenking111 <wangkun49@huawei.com> -1:1.8.0.412-b08.3 * Tue May 7 2024 kuenking111 <wangkun49@huawei.com> -1:1.8.0.412-b08.3
- add DependencyContext-mark_dependent_nmethods-crash-in-Dynamic-cds-mode.patch - add DependencyContext-mark_dependent_nmethods-crash-in-Dynamic-cds-mode.patch
- add 8138922-StubCodeDesc-constructor-publishes-partially-constructed.patch - add 8138922-StubCodeDesc-constructor-publishes-partially-constructed.patch