diff --git a/downgrade-the-glibc-symver-of-log2f-posix_spawn.patch b/downgrade-the-glibc-symver-of-log2f-posix_spawn.patch new file mode 100644 index 0000000000000000000000000000000000000000..ef48f54409855387d97403d372b33007be4ab89f --- /dev/null +++ b/downgrade-the-glibc-symver-of-log2f-posix_spawn.patch @@ -0,0 +1,47 @@ +From f03f70daa59157adcab807b393db21d57da33e23 Mon Sep 17 00:00:00 2001 +From: sunjianye +Date: Tue, 26 Oct 2021 15:49:42 +0800 +Subject: [PATCH] downgrade the glibc symver of log2f & posix_spawn + +--- + src/hotspot/share/opto/parse2.cpp | 8 ++++++++ + src/java.base/unix/native/libjava/ProcessImpl_md.c | 4 ++++ + 2 files changed, 12 insertions(+) + +diff --git a/src/hotspot/share/opto/parse2.cpp b/src/hotspot/share/opto/parse2.cpp +index becd187..9bbcb0c 100644 +--- a/src/hotspot/share/opto/parse2.cpp ++++ b/src/hotspot/share/opto/parse2.cpp +@@ -45,6 +45,14 @@ + #include "runtime/deoptimization.hpp" + #include "runtime/sharedRuntime.hpp" + ++#ifdef AARCH64 ++ __asm__(".symver log2f,log2f@GLIBC_2.17"); ++#endif ++ ++#ifdef AMD64 ++ __asm__(".symver log2f,log2f@GLIBC_2.2.5"); ++#endif ++ + #ifndef PRODUCT + extern int 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 ++++ b/src/java.base/unix/native/libjava/ProcessImpl_md.c +@@ -48,6 +48,10 @@ + + #include "childproc.h" + ++#if defined(amd64) ++ __asm__(".symver posix_spawn,posix_spawn@GLIBC_2.2.5"); ++#endif ++ + /* + * + * When starting a child on Unix, we need to do three things: +-- +1.8.3.1 + diff --git a/downgrade-the-glibc-symver-of-memcpy.patch b/downgrade-the-glibc-symver-of-memcpy.patch new file mode 100644 index 0000000000000000000000000000000000000000..8bdc71ea17137d71c7f1ef1697a7838c38fc65e6 --- /dev/null +++ b/downgrade-the-glibc-symver-of-memcpy.patch @@ -0,0 +1,96 @@ +From 2e5e3cc58933e166cba5a3f0e3c59d0ca3849196 Mon Sep 17 00:00:00 2001 +From: zhangyipeng +Date: Thu, 24 Mar 2022 11:12:46 +0800 +Subject: [PATCH] [Huawei] downgrade the glibc symver of memcpy + +Signed-off-by: Sun Jianye +--- + make/common/NativeCompilation.gmk | 9 +++++++++ + make/hotspot/lib/CompileJvm.gmk | 8 ++++++++ + src/hotspot/share/runtime/memcpy.cpp | 20 ++++++++++++++++++++ + .../linux/native/applauncher/LinuxPackage.c | 3 +++ + 4 files changed, 40 insertions(+) + create mode 100644 src/hotspot/share/runtime/memcpy.cpp + +diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk +index 1e2b170..4f22e2d 100644 +--- a/make/common/NativeCompilation.gmk ++++ b/make/common/NativeCompilation.gmk +@@ -1102,6 +1102,15 @@ define SetupNativeCompilationBody + endif + endif + ++ # if ldflags contain --wrap=memcpy, add memcpy.o to OBJS ++ ifneq ($$(findstring wrap=memcpy, $$($1_LDFLAGS)$$($1_EXTRA_LDFLAGS)),) ++ ifeq ($$(findstring memcpy$(OBJ_SUFFIX), $$($1_ALL_OBJS)),) ++ $$($1_BUILD_INFO): ++ $(ECHO) 'Adding $(SUPPORT_OUTPUTDIR)/memcpy/memcpy$(OBJ_SUFFIX) to $1_ALL_OBJS' ++ $1_ALL_OBJS += $(SUPPORT_OUTPUTDIR)/memcpy/memcpy$(OBJ_SUFFIX) ++ endif ++ endif ++ + $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \ + $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \ + $$($1_CREATE_DEBUGINFO_CMDS) $$($1_MANIFEST_VERSION) \ +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), \ + )) + ++MEMCPY_OBJECT_FILE := $(JVM_OUTPUTDIR)/objs/memcpy$(OBJ_SUFFIX) ++ ++$(eval $(call SetupCopyFiles, COPY_MEMCPY_OBJECT_FILE, \ ++ DEST := $(SUPPORT_OUTPUTDIR)/memcpy, \ ++ FILES :=$(MEMCPY_OBJECT_FILE), \ ++)) ++TARGETS += $(COPY_MEMCPY_OBJECT_FILE) ++ + # Always recompile abstract_vm_version.cpp if libjvm needs to be relinked. This ensures + # that the internal vm version is updated as it relies on __DATE__ and __TIME__ + # macros. +diff --git a/src/hotspot/share/runtime/memcpy.cpp b/src/hotspot/share/runtime/memcpy.cpp +new file mode 100644 +index 0000000..6ab4ddb +--- /dev/null ++++ b/src/hotspot/share/runtime/memcpy.cpp +@@ -0,0 +1,20 @@ ++/* ++ * Copyright (c) Huawei Technologies Co., Ltd. 2018-2021. All rights reserved. ++ */ ++ ++#if defined( __GNUC__ ) && \ ++(__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) ++#include ++ ++#if (defined AMD64) || (defined amd64) ++/* some systems do not have newest memcpy@@GLIBC_2.14 - stay with old good one */ ++asm (".symver memcpy, memcpy@GLIBC_2.2.5"); ++ ++extern "C"{ ++ void *__wrap_memcpy(void *dest, const void *src, size_t n) ++ { ++ return memcpy(dest, src, n); ++ } ++} ++#endif ++#endif +diff --git a/src/jdk.jpackage/linux/native/applauncher/LinuxPackage.c b/src/jdk.jpackage/linux/native/applauncher/LinuxPackage.c +index 5e3ef36..55a7e9c 100644 +--- a/src/jdk.jpackage/linux/native/applauncher/LinuxPackage.c ++++ b/src/jdk.jpackage/linux/native/applauncher/LinuxPackage.c +@@ -33,6 +33,9 @@ + #include "JvmLauncher.h" + #include "LinuxPackage.h" + ++#if (defined AMD64) || (defined amd64) ++__asm__(".symver memcpy, memcpy@GLIBC_2.2.5"); ++#endif + + static char* getModulePath(void) { + char modulePath[PATH_MAX] = { 0 }; +-- +1.8.3.1 + diff --git a/jdk-updates-jdk17u-jdk-17.0.1+12.tar.gz b/jdk-updates-jdk17u-jdk-17.0.1+12.tar.gz deleted file mode 100644 index 7389e52a3f4f2dcc7f494e3b9db74a9a0c21ab76..0000000000000000000000000000000000000000 Binary files a/jdk-updates-jdk17u-jdk-17.0.1+12.tar.gz and /dev/null differ diff --git a/jdk-updates-jdk17u-jdk-17.0.2+9.tar.gz b/jdk-updates-jdk17u-jdk-17.0.2+9.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b765814e4bd84807e8f5573d71695b2b40dc579d Binary files /dev/null and b/jdk-updates-jdk17u-jdk-17.0.2+9.tar.gz differ diff --git a/openjdk-latest.spec b/openjdk-latest.spec index c84af29f239ef486d6522527308a44a58949aa4d..ca896ef3a71064c4138263d64402b03499118d69 100644 --- a/openjdk-latest.spec +++ b/openjdk-latest.spec @@ -155,22 +155,27 @@ # Used via new version scheme. JDK 17 was # GA'ed in March 2021 => 21.9 %global vendor_version_string 21.9 -%global securityver 1 +%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 %global buildjdkver 17 -# We don't add any LTS designator for STS packages (this package). -# Neither for Fedora nor EPEL which would have %%{rhel} macro defined. - %global lts_designator "" - %global lts_designator_zip "" +# 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} + %global lts_designator "LTS" + %global lts_designator_zip -%{lts_designator} +%else + %global lts_designator "" + %global lts_designator_zip "" +%endif # Standard JPackage naming and versioning defines %global origin openjdk %global origin_nice OpenJDK %global top_level_dir_name %{origin} %global minorver 0 -%global buildver 12 +%global buildver 9 %global rpmrelease 2 # 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 @@ -544,7 +549,7 @@ exit 0 %endif %{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsctp.so %ifarch %{svml_arches} -%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsvml.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsvml.so %endif %{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsyslookup.so %{_jvmdir}/%{sdkdir -- %{?1}}/lib/libverify.so @@ -777,7 +782,7 @@ Requires: tzdata-java >= 2015d # tool to copy jdk's configs - should be Recommends only, but then only dnf/yum enforce it, # not rpm transaction and so no configs are persisted when pure rpm -u is run. It may be # considered as regression -Requires: copy-jdk-configs >= 3.3 +Requires: copy-jdk-configs >= 3.9 OrderWithRequires: copy-jdk-configs # for printing support Requires: cups-libs @@ -962,6 +967,9 @@ Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-d # ############################################# +# 17.0.2 +Patch7: downgrade-the-glibc-symver-of-memcpy.patch +Patch8: downgrade-the-glibc-symver-of-log2f-posix_spawn.patch BuildRequires: autoconf BuildRequires: automake @@ -1188,6 +1196,8 @@ pushd %{top_level_dir_name} %patch3 -p1 %patch4 -p1 %patch6 -p1 +%patch7 -p1 +%patch8 -p1 popd # openjdk %patch1000 @@ -1577,7 +1587,13 @@ done -- whether copy-jdk-configs is installed or not. If so, then configs are copied -- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all local posix = require "posix" -local debug = false + +if (os.getenv("debug") == "true") then + debug = true; + print("cjc: in spec debug is on") +else + debug = false; +end SOURCE1 = "%{rpm_state_dir}/copy_jdk_configs.lua" SOURCE2 = "%{_libexecdir}/copy_jdk_configs.lua" @@ -1606,8 +1622,9 @@ else end end -- run content of included file with fake args +cjc = require "copy_jdk_configs.lua" arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"} -require "copy_jdk_configs.lua" +cjc.mainProgram(arg) %post %{post_script %{nil}} @@ -1732,6 +1749,18 @@ require "copy_jdk_configs.lua" %changelog +* Tue Mar 29 2022 eapen - 1:17.0.2.9-2.rolling +- Downgrade symbols to provide compalibility to lower glibc + +* Tue Mar 29 2022 eapen - 1:17.0.2.9-1.rolling +- add openjdk-latest.yaml + +* Fri Feb 11 2022 kuenking111 - 1:17.0.2.9-0.rolling +- Update to jdk-17.0.2+9-ga + +* Wed Jan 05 2021 noah - 1:17.0.1.12-3-rolling +- adapted to newst cjc to fix issue with rpm 4.17 + * Tue Dec 21 2021 kuenking111 - 1:17.0.1.12-2-rolling - delete stack protection diff --git a/openjdk-latest.yaml b/openjdk-latest.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4752ae4c76ff844ffe0fcd6c4338d7099a04fbe3 --- /dev/null +++ b/openjdk-latest.yaml @@ -0,0 +1,5 @@ +--- +version_control: git +src_repo: https://github.com/openjdk/jdk17u +tag_prefix: jdk- +seperator: "."