From 41482aa641ce85ca8501791e4c1e5c8551f10818 Mon Sep 17 00:00:00 2001 From: zhang-mingyi66 Date: Sun, 29 Jan 2023 14:51:45 +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..e88934a --- /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 __noinline + #define __noinline __attribute__((noinline)) diff --git a/libbpf.spec b/libbpf.spec index c4752f9..891a437 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 @@ Patch6001: backport-libbpf-Ensure-functions-with-always_inline-attribute-are-inl Patch6002: backport-libbpf-Fix-the-name-of-a-reused-map.patch Patch6003: backport-libbpf-preserve-errno-across-pr_warn-pr_info-pr_debug.patch Patch6004: backport-libbpf-Fix-determine_ptr_size-guessing.patch +Patch6005: 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.3-4 +- backporting: Avoid unused function warning on bpf_tail_call_static + * Wed Jan 18 2023 zhangmingyi - 2:0.3-3 - Fix determine_ptr_size() guessing -- Gitee