sync master to openEuler-22.03-LTS-SP4 and update to jdk22+36

This commit is contained in:
佛系少年中二 2024-06-05 16:21:09 +08:00
parent 906de5315c
commit 55ca92156f
8 changed files with 116 additions and 20 deletions

View File

@ -0,0 +1,38 @@
From 1013f0b0b911d24eed216485767ec6eb080afa81 Mon Sep 17 00:00:00 2001
From: Ludovic Henry <git@ludovic.dev>
Date: Mon, 25 Sep 2023 08:01:45 +0000
Subject: [PATCH] 8316859: RISC-V: Disable detection of V through HWCAP
---
.../os_cpu/linux_riscv/vm_version_linux_riscv.cpp | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp b/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp
index 454ffbb06d390..69bbf9f366b31 100644
--- a/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp
+++ b/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp
@@ -149,12 +149,21 @@ void VM_Version::setup_cpu_available_features() {
void VM_Version::os_aux_features() {
uint64_t auxv = getauxval(AT_HWCAP);
- int i = 0;
- while (_feature_list[i] != nullptr) {
+ for (int i = 0; _feature_list[i] != nullptr; i++) {
+ if (_feature_list[i]->feature_bit() == HWCAP_ISA_V) {
+ // Special case for V: some dev boards only support RVV version 0.7, while
+ // the OpenJDK only supports RVV version 1.0. These two versions are not
+ // compatible with each other. Given the V bit is set through HWCAP on
+ // some custom kernels, regardless of the version, it can lead to
+ // generating V instructions on boards that don't support RVV version 1.0
+ // (ex: Sipeed LicheePi), leading to a SIGILL.
+ // That is an acceptable workaround as only Linux Kernel v6.5+ supports V,
+ // and that version already support hwprobe anyway
+ continue;
+ }
if ((_feature_list[i]->feature_bit() & auxv) != 0) {
_feature_list[i]->enable_feature();
}
- i++;
}
}

Binary file not shown.

Binary file not shown.

View File

@ -25,8 +25,8 @@ index becd187..9bbcb0c 100644
+#endif
+
#ifndef PRODUCT
extern int explicit_null_checks_inserted,
explicit_null_checks_elided;
extern uint explicit_null_checks_inserted,
explicit_null_checks_elided;
diff --git a/src/java.base/unix/native/libjava/ProcessImpl_md.c b/src/java.base/unix/native/libjava/ProcessImpl_md.c
index 3854f36..26cf41c 100644
--- a/src/java.base/unix/native/libjava/ProcessImpl_md.c

View File

@ -36,8 +36,8 @@ diff --git a/make/hotspot/lib/CompileJvm.gmk b/make/hotspot/lib/CompileJvm.gmk
index 65edd04..d5b689e 100644
--- a/make/hotspot/lib/CompileJvm.gmk
+++ b/make/hotspot/lib/CompileJvm.gmk
@@ -167,6 +167,14 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
PRECOMPILED_HEADER_EXCLUDE := $(JVM_PRECOMPILED_HEADER_EXCLUDE), \
@@ -204,6 +204,14 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
STATIC_LIB_EXCLUDE_OBJS := $(LIBJVM_STATIC_EXCLUDE_OBJS), \
))
+MEMCPY_OBJECT_FILE := $(JVM_OUTPUTDIR)/objs/memcpy$(OBJ_SUFFIX)

Binary file not shown.

Binary file not shown.

View File

@ -72,7 +72,7 @@
%global is_system_jdk 0
%global aarch64 aarch64 arm64 armv8
%global jit_arches x86_64 %{aarch64}
%global jit_arches x86_64 %{aarch64} riscv64
%global aot_arches x86_64 %{aarch64}
# Set of architectures for which java has short vector math library (libsvml.so)
@ -81,7 +81,7 @@
# By default, we build a debug build during main build on JIT architectures
%if %{with slowdebug}
%ifarch %{jit_arches}
%global include_debug_build 0
%global include_debug_build 1
%else
%global include_debug_build 0
%endif
@ -151,15 +151,15 @@
# New Version-String scheme-style defines
# If you bump majorver, you must bump also vendor_version_string
%global majorver 19
%global majorver 22
# Used via new version scheme. JDK 19 was
# GA'ed in March 2022 => 22.3
%global vendor_version_string 22.3
%global vendor_version_string BiSheng
%global securityver 0
# 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
%global buildjdkver 19
%global buildjdkver 22
# We don't add any LTS designator for STS packages (Fedora and EPEL).
# We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined.
%if 0%{?rhel} && !0%{?epel}
@ -539,6 +539,7 @@ exit 0
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjimage.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsound.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/liblcms.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/lible.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement_agent.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement_ext.so
@ -553,6 +554,7 @@ exit 0
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsctp.so
%ifarch %{svml_arches}
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsvml.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsimdsort.so
%endif
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsyslookup.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libverify.so
@ -599,6 +601,7 @@ exit 0
%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/management.properties
%config(noreplace) %{etcjavadir -- %{?1}}/conf/net.properties
%config(noreplace) %{etcjavadir -- %{?1}}/conf/sound.properties
%config(noreplace) %{etcjavadir -- %{?1}}/conf/jaxp.properties
%{_jvmdir}/%{sdkdir -- %{?1}}/conf
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/security
%if %is_system_jdk
@ -892,7 +895,7 @@ Name: java-latest-%{origin}
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
Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling
Release: 0
# 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
@ -927,7 +930,9 @@ 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-%{filever}+%{buildver}.tar.gz
Source0: jdk-updates-jdk%{majorver}u-jdk-%{filever}+%{buildver}.tar.gz
Source1: OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.3_9.tar.gz
Source2: OpenJDK21U-jdk_x64_linux_hotspot_21.0.3_9.tar.gz
Source8: systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz
# Desktop files. Adapted from IcedTea
@ -960,10 +965,7 @@ Patch1: rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch
# Restrict access to java-atk-wrapper classes
Patch2: rh1648644-java_access_bridge_privileged_security.patch
Patch3: rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch
# Follow system wide crypto policy RHBZ#1249083
Patch4: pr3183-rh1340845-support_system_crypto_policy.patch
# 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
#############################################
#
@ -975,6 +977,13 @@ Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-d
Patch7: downgrade-the-glibc-symver-of-memcpy.patch
Patch8: downgrade-the-glibc-symver-of-log2f-posix_spawn.patch
############################################
#
# RISC-V specific patches
#
############################################
Patch2000: 8316859-RISC-V-Disable-detection-of-V-through-HWCAP.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: alsa-lib-devel
@ -1201,14 +1210,18 @@ pushd %{top_level_dir_name}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
popd # openjdk
%patch1000
%ifarch riscv64
pushd %{top_level_dir_name}
%patch2000 -p1
popd
%endif
# Extract systemtap tapsets
%if %{with_systemtap}
tar --strip-components=1 -x -I xz -f %{SOURCE8}
@ -1311,6 +1324,23 @@ if [ "x${EA_DESIGNATOR}" != "x%{expected_ea_designator}" ] ; then
exit 17
fi
ARCH=$(uname -m)
BOOTJDKPATH=/usr/lib/jvm/java-%{buildjdkver}-openjdk
if [ "$ARCH" = "x86_64" ]; then
tar -xf %{SOURCE2}
BOOTJDKPATH=$PWD/jdk-21.0.3+9
elif [ "$ARCH" = "aarch64" ]; then
tar -xf %{SOURCE1}
BOOTJDKPATH=$PWD/jdk-21.0.3+9
elif [ "$ARCH" = "riscv64" ]; then
:
else
echo " Failed to set BOOTJDKPATH "
exit 18
fi
echo $BOOTJDKPATH
mkdir -p %{buildoutputdir -- $suffix}
pushd %{buildoutputdir -- $suffix}
@ -1320,16 +1350,19 @@ bash ../configure \
%endif
%ifarch %{ppc64le}
--with-jobs=1 \
%endif
%if "%toolchain" == "clang"
--with-toolchain-type=clang \
%endif
--with-version-build=%{buildver} \
--with-version-pre=\"${EA_DESIGNATOR}\" \
--with-version-opt=%{lts_designator} \
--with-vendor-version-string="%{vendor_version_string}" \
--with-vendor-name="openEuler Community" \
--with-vendor-name="BiSheng" \
--with-vendor-url="https://openeuler.org/" \
--with-vendor-bug-url="%{bug_url}" \
--with-vendor-vm-bug-url="%{bug_url}" \
--with-boot-jdk=/usr/lib/jvm/java-%{buildjdkver}-openjdk \
--with-boot-jdk=$BOOTJDKPATH \
--with-debug-level=$debugbuild \
--with-native-debug-symbols=internal \
--enable-unlimited-crypto \
@ -1458,10 +1491,10 @@ end
run -version
EOF
grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
#grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
# Check src.zip has all sources. See RHBZ#1130490
jar -tf $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe'
#jar -tf $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe'
# Check class files include useful debugging information
$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from"
@ -1752,6 +1785,31 @@ cjc.mainProgram(arg)
%changelog
* Wed Jun 05 2024 Autistic_boyya <wangzhongyi7@huawei.com> - 1:22.0.0.36-rolling
- update to jdk22+36
* Mon May 06 2024 Dingli Zhang <dingli@iscas.ac.cn> - 1:21.0.0.35-2
- Backport JDK-8316859 for riscv64
* Mon Nov 27 2023 kuenking111 <wangkun49@huawei.com> - 1:21.0.0.35-1
- Change vendor name to BiSheng
* Sat Oct 7 2023 kuenking111 <wangkun49@huawei.com> - 1:21.0.0.35-0-rolling
- upgrade to jdk21+35
* Mon Aug 07 2023 misaka00251 <liuxin@iscas.ac.cn> - 1:20.0.2.9-1-rolling
- Add riscv64 to jit_arches
* Thu Aug 3 2023 wanghao <wanghao564@huawei.com> - 1:20.0.2.9-0-rolling
- Update to jdk-20.0.2+9
* Thu May 4 2023 wanghao <wanghao564@huawei.com> - 1:20.0.1.9-0-rolling
- Update to jdk-20.0.1+9
- remove pr3183-rh1340845-support_system_crypto_policy.patch
* Wed Feb 1 2023 DXwangg <wangjiawei80@huawei.com> - 1:19.0.2.7-0-rolling
- Update to jdk-19.0.2+7
* Wed Nov 2 2022 DXwangg <wangjiawei80@huawei.com> - 1:19.0.0.36-1.rolling
- set build jdk to 19