summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/perf/perf.bbappend
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/perf/perf.bbappend')
-rw-r--r--recipes-kernel/perf/perf.bbappend17
1 files changed, 17 insertions, 0 deletions
diff --git a/recipes-kernel/perf/perf.bbappend b/recipes-kernel/perf/perf.bbappend
new file mode 100644
index 00000000..54ad4dd9
--- /dev/null
+++ b/recipes-kernel/perf/perf.bbappend
@@ -0,0 +1,17 @@
1# Fix const qualifier warnings in libbpf.c when building with -Werror
2# This is a workaround for older kernel versions (6.12.x) that don't have
3# the upstream fix yet. The issue is already fixed in kernel 6.13+.
4
5# remove at next version upgrade or when output changes
6PR = "r3"
7HASHEQUIV_HASH_VERSION .= ".3"
8
9do_configure:prepend () {
10 # Apply libbpf const qualifier fixes
11 if [ -e "${S}/tools/lib/bpf/libbpf.c" ]; then
12 # Fix kallsyms_cb function - change 'char *res' to 'const char *res'
13 sed -i 's/^\(\s*\)char \*res;/\1const char *res;/' "${S}/tools/lib/bpf/libbpf.c"
14 # Fix resolve_full_path function - change 'char *next_path' to 'const char *next_path'
15 sed -i 's/^\(\s*\)char \*next_path;/\1const char *next_path;/' "${S}/tools/lib/bpf/libbpf.c"
16 fi
17}