backport patche from upstream

backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch

Signed-off-by: jinzhiguang <jinzhiguang@kylinos.cn>
(cherry picked from commit 9fe1f73b4e8927a170f95284d0d16b5369f2cde0)
This commit is contained in:
jinzhiguang 2024-04-28 13:53:44 +08:00 committed by openeuler-sync-bot
parent db2a44cb0d
commit 08820d98cf
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From e399146fd1e0fd033be8d54da0bf7b621d5379a6 Mon Sep 17 00:00:00 2001
From: jinzhiguang <jinzhiguang@kylinos.cn>
Date: Wed, 3 Apr 2024 17:07:36 +0800
Subject: [PATCH 1/3] libbpf: Modify the function name in libbpf.c, to match
the symbols in the libbpf.map file
Change the function name bpf_object__pin_instance to bpf_program__pin_instance,
so that the symbol can be found in the .so file.
Signed-off-by: jinzhiguang <jinzhiguang@kylinos.cn>
---
src/libbpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libbpf.c b/src/libbpf.c
index ef7f302..4df5147 100644
--- a/src/libbpf.c
+++ b/src/libbpf.c
@@ -8047,7 +8047,7 @@ static int bpf_program_unpin_instance(struct bpf_program *prog, const char *path
}
__attribute__((alias("bpf_program_pin_instance")))
-int bpf_object__pin_instance(struct bpf_program *prog, const char *path, int instance);
+int bpf_program__pin_instance(struct bpf_program *prog, const char *path, int instance);
__attribute__((alias("bpf_program_unpin_instance")))
int bpf_program__unpin_instance(struct bpf_program *prog, const char *path, int instance);
--
2.27.0

View File

@ -4,7 +4,7 @@
Name: %{githubname}
Version: %{githubver}
Release: 12
Release: 13
Summary: Libbpf library
License: LGPLv2 or BSD
@ -41,6 +41,7 @@ Patch0024: backport-libbpf-make-RINGBUF-map-size-adjustments-more-eagerly.p
Patch0025: backport-libbpf-Fix-NULL-pointer-dereference-in_bpf_object__c.patch
Patch0026: backport-libbpf-Fix-str_has_sfxs-return-value.patch
Patch0027: backport-libbpf-Initialize-err-in-probe_map_create.patch
Patch0028: backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch
# This package supersedes libbpf from kernel-tools,
# which has default Epoch: 0. By having Epoch: 1
@ -93,6 +94,10 @@ developing applications that use %{name}
%{_libdir}/libbpf.a
%changelog
* Sun Apr 28 2024 jinzhiguang <jinzhiguang@kylinos.cn> - 2:0.8.1-13
- backport patch from upstream:
backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch
* Mon Apr 15 2024 zhangmingyi <zhangmingyi5@huawei.com> 2:0.8.1-12
- backport patches from upstream:
backport-libbpf-Fix-NULL-pointer-dereference-in_bpf_object__c.patch