From 25d2e9586da5835c9ec555d649da3c18d15bc2ca Mon Sep 17 00:00:00 2001 From: zhang-mingyi66 Date: Sun, 29 Jan 2023 15:18:46 +0800 Subject: [PATCH] backporting --- ...tion-warning-on-bpf_tail_call_static.patch | 30 +++++++++++++++++++ libbpf.spec | 6 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 backport-libbpf-Avoid-unused-function-warning-on-bpf_tail_call_static.patch diff --git a/backport-libbpf-Avoid-unused-function-warning-on-bpf_tail_call_static.patch b/backport-libbpf-Avoid-unused-function-warning-on-bpf_tail_call_static.patch new file mode 100644 index 0000000..8ce21b2 --- /dev/null +++ b/backport-libbpf-Avoid-unused-function-warning-on-bpf_tail_call_static.patch @@ -0,0 +1,30 @@ +From f15814c93ade62519c9ccb50a8ca5c8998010ac2 Mon Sep 17 00:00:00 2001 +From: Ian Rogers +Date: Wed, 13 Jan 2021 14:36:08 -0800 +Subject: [PATCH] bpf, libbpf: Avoid unused function warning on + bpf_tail_call_static + +Add inline to __always_inline making it match the linux/compiler.h. +Adding this avoids an unused function warning on bpf_tail_call_static +when compining with -Wall. + +Signed-off-by: Ian Rogers +Signed-off-by: Andrii Nakryiko +Link: https://lore.kernel.org/bpf/20210113223609.3358812-1-irogers@google.com +--- + src/bpf_helpers.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bpf_helpers.h b/src/bpf_helpers.h +index 72b25111..ae6c975e 100644 +--- a/src/bpf_helpers.h ++++ b/src/bpf_helpers.h +@@ -30,7 +30,7 @@ + #define SEC(NAME) __attribute__((section(NAME), used)) + + #ifndef __always_inline +-#define __always_inline __attribute__((always_inline)) ++#define __always_inline inline __attribute__((always_inline)) + #endif + #ifndef __weak + #define __weak __attribute__((weak)) diff --git a/libbpf.spec b/libbpf.spec index 5ae0069..f3eb217 100644 --- a/libbpf.spec +++ b/libbpf.spec @@ -4,7 +4,7 @@ Name: %{githubname} Version: %{githubver} -Release: 3 +Release: 4 Summary: Libbpf library License: LGPLv2 or BSD @@ -17,6 +17,7 @@ Patch0000: backport-libbpf-Ensure-functions-with-always_inline-attribute-ar Patch0001: backport-libbpf-Fix-the-name-of-a-reused-map.patch Patch0002: backport-libbpf-preserve-errno-across-pr_warn-pr_info-pr_debug.patch Patch0003: backport-libbpf-Fix-determine_ptr_size-guessing.patch +Patch0004: backport-libbpf-Avoid-unused-function-warning-on-bpf_tail_call_static.patch # This package supersedes libbpf from kernel-tools, # which has default Epoch: 0. By having Epoch: 1 @@ -68,6 +69,9 @@ developing applications that use %{name} %{_libdir}/libbpf.a %changelog +* Sun Jan 29 2023 zhangmingyi - 2:0.1.1-4 +- backporting: backport-libbpf-Avoid-unused-function-warning-on-bpf_tail_call_static.patch + * Thu Jan 19 2023 zhangmingyi - 2:0.1.1-3 - backporting: backport-libbpf-Fix-determine_ptr_size-guessing.patch -- Gitee