Projects
home:dingli:branches:openEuler:24.09-openjdk
openjdk-latest
_service:tar_scm:downgrade-the-glibc-symver-of-...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:downgrade-the-glibc-symver-of-memcpy.patch of Package openjdk-latest
From 2e5e3cc58933e166cba5a3f0e3c59d0ca3849196 Mon Sep 17 00:00:00 2001 From: zhangyipeng <zhangyipeng7@huawei.com> Date: Thu, 24 Mar 2022 11:12:46 +0800 Subject: [PATCH] [Huawei] downgrade the glibc symver of memcpy Signed-off-by: Sun Jianye <sunjianye@huawei.com> --- make/common/native/Link.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/native/Link.gmk b/make/common/native/Link.gmk index 1e2b170..4f22e2d 100644 --- a/make/common/native/Link.gmk +++ b/make/common/native/Link.gmk @@ -131,6 +131,15 @@ define SetupNativeCompilationBody $1_CODESIGN_OPTS := - 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_DEBUGINFO_FILES) $$($1_STRIPFLAGS) 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 @@ -254,6 +254,14 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \ $(BUILD_LIBJVM_TARGET): $(WIN_EXPORT_FILE) endif +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 <string.h> + +#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
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2