Compare commits

...

4 Commits

Author SHA1 Message Date
David Abdurachmanov 16757e5928
Add support for riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2021-05-24 21:13:01 +03:00
Severin Gehwolf 2983f39cc6 Update to July 2019 CPU 2019-07-18 11:30:15 +02:00
Petra Mikova 1be922c14f Fixed requires/provides for non-system jdk (backport of RHBZ#1702324) 2019-05-26 09:30:15 +02:00
pmikova ad609b33e6 Updated sources to the latest CPU 2019-04-18 14:04:59 +02:00
7 changed files with 3692 additions and 17 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
/jdk-jdk12-jdk-12+33.tar.xz
/systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz
/jdk-updates-jdk12u-jdk-12.0.1+12.tar.xz
/jdk-updates-jdk12u-jdk-12.0.2+9.tar.xz

1703
config.guess vendored Normal file

File diff suppressed because it is too large Load Diff

1864
config.sub vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,71 @@
diff --git a/openjdk/make/autoconf/platform.m4 b/openjdk/make/autoconf/platform.m4
index 39134d121..e6419d1b6 100644
--- a/openjdk/make/autoconf/platform.m4
+++ b/openjdk/make/autoconf/platform.m4
@@ -156,6 +156,18 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
VAR_CPU_BITS=64
VAR_CPU_ENDIAN=big
;;
+ riscv32)
+ VAR_CPU=riscv32
+ VAR_CPU_ARCH=riscv
+ VAR_CPU_BITS=32
+ 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])
;;
diff --git a/openjdk/src/hotspot/os/linux/os_linux.cpp b/openjdk/src/hotspot/os/linux/os_linux.cpp
index 1d9753688..ae5b794b9 100644
--- a/openjdk/src/hotspot/os/linux/os_linux.cpp
+++ b/openjdk/src/hotspot/os/linux/os_linux.cpp
@@ -1667,6 +1667,9 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
#ifndef EM_AARCH64
#define EM_AARCH64 183 /* ARM AARCH64 */
#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"},
@@ -1692,6 +1695,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_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"},
+ {EM_RISCV, EM_RISCV, ELFCLASSNONE, ELFDATA2MSB, (char*)"RISC-V"},
};
#if (defined IA32)
@@ -1726,9 +1730,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
static Elf32_Half running_arch_code=EM_68K;
#elif (defined SH)
static Elf32_Half running_arch_code=EM_SH;
+#elif (defined __riscv)
+ static Elf32_Half running_arch_code=EM_RISCV;
#else
#error Method os::dll_load requires that one of following is defined:\
- AARCH64, ALPHA, ARM, AMD64, IA32, IA64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, S390, SH, __sparc
+ AARCH64, ALPHA, ARM, AMD64, IA32, IA64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, S390, SH, __sparc, __riscv
#endif
// Identify compatability class for VM's architecture and library's architecture
@@ -1761,10 +1767,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) {

View File

@ -184,6 +184,9 @@
%ifarch %{aarch64}
%global archinstall aarch64
%endif
%ifarch riscv64
%global archinstall riscv64
%endif
# 32 bit sparc, optimized for v9
%ifarch sparcv9
%global archinstall sparc
@ -206,7 +209,7 @@
# New Version-String scheme-style defines
%global majorver 12
%global securityver 0
%global securityver 2
# buildjdkver is usually same as %%{majorver},
# but in time of bootstrap of next jdk, it is majorver-1,
# and this it is better to change it here, on single place
@ -224,7 +227,7 @@
%global origin_nice OpenJDK
%global top_level_dir_name %{origin}
%global minorver 0
%global buildver 33
%global buildver 9
# priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit
%if %is_system_jdk
%global priority %( printf '%02d%02d%02d%02d' %{majorver} %{minorver} %{securityver} %{buildver} )
@ -251,14 +254,16 @@
# fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349
# https://bugzilla.redhat.com/show_bug.cgi?id=1590796#c14
# https://bugzilla.redhat.com/show_bug.cgi?id=1655938
%if %is_system_jdk
%global _privatelibs libsplashscreen[.]so.*|libawt_xawt[.]so.*|libjli[.]so.*|libattach[.]so.*|libawt[.]so.*|libextnet[.]so.*|libawt_headless[.]so.*|libdt_socket[.]so.*|libfontmanager[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas[.]so.*|libjavajpeg[.]so.*|libjdwp[.]so.*|libjimage[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmanagement_agent[.]so.*|libmanagement_ext[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libprefs[.]so.*|librmi[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsunec[.]so.*|libunpack[.]so.*|libzip[.]so.*
%global _publiclibs libjawt[.]so.*|libjava[.]so.*|libjvm[.]so.*|libverify[.]so.*|libjsig[.]so.*
%if %is_system_jdk
%global __provides_exclude ^(%{_privatelibs})$
%global __requires_exclude ^(%{_privatelibs})$
%global __provides_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$
%else
%global __provides_exclude lib.*[.]so.*
%global __requires_exclude lib.*[.]so.*
# Don't generate provides/requires for JDK provided shared libraries at all.
%global __provides_exclude ^(%{_privatelibs}|%{_publiclibs})$
%global __requires_exclude ^(%{_privatelibs}|%{_publiclibs})$
%endif
@ -948,7 +953,7 @@ Version: %{newjavaver}.%{buildver}
# This package needs `.rolling` as part of Release so as to not conflict on install with
# java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as
# java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298
Release: 4.rolling%{?dist}
Release: 1.rolling.0.riscv64%{?dist}
# 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
# also included the epoch in their virtual provides. This created a
@ -982,7 +987,7 @@ URL: http://openjdk.java.net/
# to regenerate source0 (jdk) and source8 (jdk's taspets) run update_package.sh
# update_package.sh contains hard-coded repos, revisions, tags, and projects to regenerate the source archives
Source0: jdk-jdk%{majorver}-jdk-%{majorver}+%{buildver}.tar.xz
Source0: jdk-updates-jdk%{majorver}u-jdk-%{majorver}.%{minorver}.%{securityver}+%{buildver}.tar.xz
Source8: systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz
# Desktop files. Adapted from IcedTea
@ -1000,6 +1005,10 @@ Source13: TestCryptoLevel.java
# Ensure ECDSA is working
Source14: TestECDSA.java
# New versions of config files with RISC-V (riscv64) support.
Source100: config.guess
Source101: config.sub
############################################
#
# RPM/distribution specific patches
@ -1022,6 +1031,9 @@ Patch5: pr1983-rh1565658-support_using_the_system_installation_of_nss_with_th
# Depend on pcs-lite-libs instead of pcs-lite-devel as this is only in optional repo
Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch
# RISC-V (riscv64) support
Patch30: java-12-openjdk-riscv64.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: alsa-lib-devel
@ -1259,6 +1271,12 @@ if [ $prioritylength -ne 8 ] ; then
exit 14
fi
%ifarch riscv64
# Update config.{guess,sub} with RISC-V (riscv64) support
cp %{SOURCE100} openjdk/make/autoconf/build-aux/autoconf-config.guess
cp %{SOURCE101} openjdk/make/autoconf/build-aux/autoconf-config.sub
%endif
# OpenJDK patches
# Remove libraries that are linked
@ -1270,6 +1288,9 @@ pushd %{top_level_dir_name}
%patch4 -p1
%patch5 -p1
%patch6 -p1
%ifarch riscv64
%patch30 -p2
%endif
popd # openjdk
%patch1000
@ -1328,7 +1349,7 @@ export NUM_PROC=${NUM_PROC:-1}
[ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max}
%endif
%ifarch s390x sparc64 alpha %{power64} %{aarch64}
%ifarch s390x sparc64 alpha %{power64} %{aarch64} riscv64
export ARCH_DATA_MODEL=64
%endif
%ifarch alpha
@ -1510,7 +1531,10 @@ quit
end
run -version
EOF
%ifnarch riscv64
grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
%endif
# Check src.zip has all sources. See RHBZ#1130490
jar -tf $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe'
@ -1592,7 +1616,7 @@ popd
# Install Javadoc documentation
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}
cp -a %{buildoutputdir -- $suffix}/images/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}
cp -a %{buildoutputdir -- $suffix}/bundles/jdk-%{majorver}+%{buildver}%{lts_designator_zip}-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip
cp -a %{buildoutputdir -- $suffix}/bundles/jdk-%{majorver}.%{minorver}.%{securityver}+%{buildver}%{lts_designator_zip}-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip
# Install icons and menu entries
for s in 16 24 32 48 ; do
@ -1822,10 +1846,22 @@ require "copy_jdk_configs.lua"
%changelog
* Thu Apr 04 2019 Petra Mikova <pmikova@redhat.com - 1:12.0.0.33-4.rolling
* Mon May 24 2021 David Abdurachmanov <david.abdurachmanov@gmail.com> - 1:12.0.2.9-1.rolling.0.riscv64
- Add support for riscv64
* Thu Jul 18 2019 Severin Gehwolf <sgehwolf@redhat.com> - 1:12.0.2.9-1.rolling
- Update to July 2019 CPU update (tag jdk-12.0.2+9)
* Tue May 21 2019 Petra Alice Mikova <pmikova@redhat.com> - 1:12.0.1.12-2.rolling
- fixed requires/provides for the non-system JDK case (backport of RHBZ#1702324)
* Thu Apr 18 2019 Petra Mikova <pmikova@redhat.com> - 1:12.0.1.12-1.rolling
- updated sources to current CPU release
* Thu Apr 04 2019 Petra Mikova <pmikova@redhat.com> - 1:12.0.0.33-4.rolling
- added slave for jfr binary in devel package
* Thu Mar 21 2019 Petra Mikova <pmikova@redhat.com - 1:12.0.0.33-3.rolling
* Thu Mar 21 2019 Petra Mikova <pmikova@redhat.com> - 1:12.0.0.33-3.rolling
- Replaced pcsc-lite-devel (which is in optional channel) with pcsc-lite-libs.
- added rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch to make jdk work with pcsc
- removed LTS string from LTS designator, because epel builds get identified as rhel and JDK 12 is not LTS

View File

@ -1,2 +1,2 @@
SHA512 (jdk-jdk12-jdk-12+33.tar.xz) = e2dea9585fe07ae87fb313d090e9850a547e2ba84a7447d42acd0a04874599ef240f7b6ccaa69955cab5d12f646711cb4467e1b24e090af476e9ff708cc168fe
SHA512 (jdk-updates-jdk12u-jdk-12.0.2+9.tar.xz) = ed1b5dec108fb29f72a8a80faca22703d3d1378d5a3b535c9e41b8f73d51d6650dd72e0e4b2e79de61c9f85013b26f39f6a7b5292b646bd6f5b3a54c9922fbf9
SHA512 (systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz) = cf578221b77d8c7e019f69909bc86c419c5fb5e10bceba9592ff6e7f96887b0a7f07c9cefe90800975247a078785ca190fdec5c2d0f841bb447cee784b570f7d

View File

@ -31,11 +31,10 @@ else
echo ${TAPSET}
fi
# OpenJDK from Shenandoah project
export PROJECT_NAME="jdk"
export REPO_NAME="jdk12"
# warning, clonning without shenadnaoh suffix, you will clone pure jdk - thus without shenandaoh GC
export VERSION="jdk-12+25"
# OpenJDK from jdk-updates/jdk12u
export PROJECT_NAME="jdk-updates"
export REPO_NAME="jdk12u"
export VERSION="jdk-12.0.2+9"
export COMPRESSION=xz
# unset tapsets overrides
export OPENJDK_URL=""