From: @openeuler-sync-bot Reviewed-by: @imxcc Signed-off-by: @imxcc
This commit is contained in:
commit
5e293cf85e
58
elf-strip-adapt-to-new-gcc-version-10.3.1.patch
Normal file
58
elf-strip-adapt-to-new-gcc-version-10.3.1.patch
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
From abfc33435c25e1515e35768c9a2d684aa72dc780 Mon Sep 17 00:00:00 2001
|
||||||
|
From: jiang-dawei15 <jiangdawei15@huawei.com>
|
||||||
|
Date: Mon, 28 Feb 2022 15:34:11 +0800
|
||||||
|
Subject: [PATCH 1/3] elf/strip: adapt to new gcc version(10.3.1)
|
||||||
|
|
||||||
|
This patch fix the following problems:
|
||||||
|
1. new libc so use new naming method,such as: libc.6.so -> libc.so.6;
|
||||||
|
2. destroy .rela section sh_flags INFO property;
|
||||||
|
|
||||||
|
Signed-off-by: Bihong Yu <yubihong@huawei.com>
|
||||||
|
---
|
||||||
|
src/kpatch_elf.c | 9 +++------
|
||||||
|
src/kpatch_strip.c | 5 +++--
|
||||||
|
2 files changed, 6 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/kpatch_elf.c b/src/kpatch_elf.c
|
||||||
|
index 5acf370..260209a 100644
|
||||||
|
--- a/src/kpatch_elf.c
|
||||||
|
+++ b/src/kpatch_elf.c
|
||||||
|
@@ -180,16 +180,13 @@ static int
|
||||||
|
elf_object_is_interp_exception(struct object_file *o)
|
||||||
|
{
|
||||||
|
/* libc */
|
||||||
|
- if (!strncmp(o->name, "libc", 4) &&
|
||||||
|
- !strncmp(o->name + strlen(o->name) - 3, ".so", 3))
|
||||||
|
+ if (!strncmp(o->name, "libc.", 5))
|
||||||
|
return 1;
|
||||||
|
/* libpthread */
|
||||||
|
- if (!strncmp(o->name, "libpthread", 10) &&
|
||||||
|
- !strncmp(o->name + strlen(o->name) - 3, ".so", 3))
|
||||||
|
+ if (!strncmp(o->name, "libpthread.", 11))
|
||||||
|
return 1;
|
||||||
|
/* libdl */
|
||||||
|
- if (!strncmp(o->name, "libdl", 5) &&
|
||||||
|
- !strncmp(o->name + strlen(o->name) - 3, ".so", 3))
|
||||||
|
+ if (!strncmp(o->name, "libdl.", 6))
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
diff --git a/src/kpatch_strip.c b/src/kpatch_strip.c
|
||||||
|
index 5717e5a..6420af9 100644
|
||||||
|
--- a/src/kpatch_strip.c
|
||||||
|
+++ b/src/kpatch_strip.c
|
||||||
|
@@ -220,8 +220,9 @@ static int kpatch_strip(Elf *elfin, Elf *elfout)
|
||||||
|
} else {
|
||||||
|
kpinfo("don't need it\n");
|
||||||
|
shout.sh_type = SHT_NOBITS;
|
||||||
|
- shout.sh_link = 0;
|
||||||
|
- shout.sh_info = 0;
|
||||||
|
+ /* destroy the .rela section sh_flags INFO property */
|
||||||
|
+ if (!strncmp(scnname, ".rela", 5))
|
||||||
|
+ shout.sh_flags = SHF_ALLOC;
|
||||||
|
}
|
||||||
|
if (!gelf_update_shdr(scnout, &shout)) {
|
||||||
|
kperr("Failed to do gelf_update_shdr need");
|
||||||
|
--
|
||||||
|
2.23.0.windows.1
|
||||||
|
|
||||||
26
gitignore-ignore-some-tests-and-binary.patch
Normal file
26
gitignore-ignore-some-tests-and-binary.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
From 04c295b9ca272dbd3525a6fa4be4869fe65d59aa Mon Sep 17 00:00:00 2001
|
||||||
|
From: jiang-dawei15 <jiangdawei15@huawei.com>
|
||||||
|
Date: Mon, 28 Feb 2022 15:56:54 +0800
|
||||||
|
Subject: [PATCH 2/3] gitignore: ignore some tests and binary
|
||||||
|
|
||||||
|
Signed-off-by: Bihong Yu <yubihong@huawei.com>
|
||||||
|
---
|
||||||
|
.gitignore | 4 ++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/.gitignore b/.gitignore
|
||||||
|
index 065f093..696dfee 100644
|
||||||
|
--- a/.gitignore
|
||||||
|
+++ b/.gitignore
|
||||||
|
@@ -7,4 +7,8 @@ src/libcare-cc
|
||||||
|
src/libcare-client
|
||||||
|
src/libcare-ctl
|
||||||
|
src/libcare-stresstest
|
||||||
|
+src/libcare-server
|
||||||
|
+src/libcare-dump
|
||||||
|
+src/arch.desc
|
||||||
|
tags
|
||||||
|
+tests/*
|
||||||
|
--
|
||||||
|
2.23.0.windows.1
|
||||||
|
|
||||||
82
libcare-patch-make-adapt-libcare-patch-make-to-meson.patch
Normal file
82
libcare-patch-make-adapt-libcare-patch-make-to-meson.patch
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
From 7b84765925c8b08f6bb061e66aabebdc814f0168 Mon Sep 17 00:00:00 2001
|
||||||
|
From: jiang-dawei15 <jiangdawei15@huawei.com>
|
||||||
|
Date: Mon, 28 Feb 2022 16:27:22 +0800
|
||||||
|
Subject: [PATCH 3/3] libcare-patch-make: adapt libcare-patch-make to meson
|
||||||
|
|
||||||
|
Signed-off-by: Bihong Yu <yubihong@huawei.com>
|
||||||
|
---
|
||||||
|
src/libcare-patch-make | 33 +++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 33 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/libcare-patch-make b/src/libcare-patch-make
|
||||||
|
index 320ab88..ad1b566 100755
|
||||||
|
--- a/src/libcare-patch-make
|
||||||
|
+++ b/src/libcare-patch-make
|
||||||
|
@@ -53,6 +53,10 @@ prepare_env() {
|
||||||
|
LPMAKE_PATCHED_DIR="${LPMAKE_PATCHED_DIR-$PWD/.lpmaketmp/patched}"
|
||||||
|
LPMAKE_PATCHROOT="${LPMAKE_PATCHROOT-$PWD/patchroot}"
|
||||||
|
|
||||||
|
+ LIBCARE_CC=$CC
|
||||||
|
+ SYMBOLINK_CC=$(which cc)
|
||||||
|
+ REAL_CC=$(realpath $SYMBOLINK_CC)
|
||||||
|
+
|
||||||
|
export LPMAKE_ORIGINAL_DIR LPMAKE_PATCHED_DIR LPMAKE_PATCHROOT
|
||||||
|
mkdir -p "$LPMAKE_ORIGINAL_DIR" "$LPMAKE_PATCHED_DIR" "$LPMAKE_PATCHROOT"
|
||||||
|
|
||||||
|
@@ -79,6 +83,26 @@ restore_origs() {
|
||||||
|
|
||||||
|
trap "restore_origs" 0
|
||||||
|
|
||||||
|
+change_qemu_ld_flags() {
|
||||||
|
+ qemu_ld_flags=$(grep "^QEMU_LDFLAGS=" config-host.mak)
|
||||||
|
+ ret=$(echo $qemu_ld_flags | grep "\-Wl,-q")
|
||||||
|
+ if [[ "$ret" == "" ]];then
|
||||||
|
+ qemu_ld_flags="${qemu_ld_flags} -Wl,-q"
|
||||||
|
+ echo "change QEMU_LDFLAGS to '${qemu_ld_flags}'"
|
||||||
|
+ sed -i "/^QEMU_LDFLAGS=/c\\${qemu_ld_flags}" config-host.mak
|
||||||
|
+ fi
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+replace_cc_symbolink() {
|
||||||
|
+ unlink $SYMBOLINK_CC
|
||||||
|
+ ln -s $LIBCARE_CC $SYMBOLINK_CC
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+recover_cc_symbolink() {
|
||||||
|
+ unlink $SYMBOLINK_CC
|
||||||
|
+ ln -s $REAL_CC $SYMBOLINK_CC
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
build_objects() {
|
||||||
|
restore_origs
|
||||||
|
|
||||||
|
@@ -93,6 +117,9 @@ build_objects() {
|
||||||
|
export KPATCH_STAGE=original
|
||||||
|
export KPCC_DBGFILTER_ARGS=""
|
||||||
|
|
||||||
|
+ #add '-Wl,-q' to LD_FLAGS
|
||||||
|
+ change_qemu_ld_flags
|
||||||
|
+
|
||||||
|
echo "${green}BUILDING ORIGINAL CODE${reset}"
|
||||||
|
make $LPMAKEFILE $JOBS_MAKE >$MAKE_OUTPUT 2>&1
|
||||||
|
|
||||||
|
@@ -237,10 +264,16 @@ main() {
|
||||||
|
|
||||||
|
prepare_env
|
||||||
|
|
||||||
|
+ # replace cc
|
||||||
|
+ replace_cc_symbolink
|
||||||
|
+
|
||||||
|
if test -z "$only_update"; then
|
||||||
|
build_objects "$@"
|
||||||
|
fi
|
||||||
|
build_kpatches
|
||||||
|
+
|
||||||
|
+ # recover cc
|
||||||
|
+ recover_cc_symbolink
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
|
--
|
||||||
|
2.23.0.windows.1
|
||||||
|
|
||||||
@ -3,7 +3,7 @@
|
|||||||
Version: 1.0.0
|
Version: 1.0.0
|
||||||
Name: libcareplus
|
Name: libcareplus
|
||||||
Summary: LibcarePlus tools
|
Summary: LibcarePlus tools
|
||||||
Release: 3
|
Release: 4
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Url: https://gitee.com/openeuler/libcareplus
|
Url: https://gitee.com/openeuler/libcareplus
|
||||||
@ -12,6 +12,10 @@ Source0: %{name}-%{version}.tar.gz
|
|||||||
Patch0001: fix-cblock-parse-for-LCOLD-LHOT-.cold.NUM-.init_arra.patch
|
Patch0001: fix-cblock-parse-for-LCOLD-LHOT-.cold.NUM-.init_arra.patch
|
||||||
Patch0002: gensrc-we-should-add-align-while-FLAGS_PUSH_SECTION-.patch
|
Patch0002: gensrc-we-should-add-align-while-FLAGS_PUSH_SECTION-.patch
|
||||||
Patch0003: elf-add-section-adderss-for-STT_NOTYPE-type-of-symbo.patch
|
Patch0003: elf-add-section-adderss-for-STT_NOTYPE-type-of-symbo.patch
|
||||||
|
Patch0004: elf-strip-adapt-to-new-gcc-version-10.3.1.patch
|
||||||
|
Patch0005: gitignore-ignore-some-tests-and-binary.patch
|
||||||
|
Patch0006: libcare-patch-make-adapt-libcare-patch-make-to-meson.patch
|
||||||
|
|
||||||
|
|
||||||
BuildRequires: elfutils-libelf-devel libunwind-devel gcc systemd
|
BuildRequires: elfutils-libelf-devel libunwind-devel gcc systemd
|
||||||
|
|
||||||
@ -143,6 +147,11 @@ exit 0
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Feb 28 2022 imxcc <xingchaochao@huawei.com> - 1.0.0.4
|
||||||
|
- libcare-patch-make: adapt libcare-patch-make to meson
|
||||||
|
- gitignore: ignore some tests and binary
|
||||||
|
- elf/strip: adapt to new gcc version(10.3.1)
|
||||||
|
|
||||||
* Tue Feb 22 2022 imxcc <xingchaochao@huawei.com> - 1.0.0.3
|
* Tue Feb 22 2022 imxcc <xingchaochao@huawei.com> - 1.0.0.3
|
||||||
- libcareplus.spec:remove libcare.service and libcare.socket
|
- libcareplus.spec:remove libcare.service and libcare.socket
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user