Skip to contentSkip to conversation

bpftool-native: Fix -Wdiscarded-qualifiers errors for glibc 2.42+

PATCH New He Zhe 1 participant 1 message May 13

lore
Share & tools
lore

He Zhe

author
#0 lore raw

PATCH v2 1/1 bpftool-native: Fix -Wdiscarded-qualifiers errors for glibc 2.42+

Backport a patch from kernel to fix the following build errors.

bbpf.c: In function ‘kallsyms_cb’:

| libbpf.c:8192:13: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
|  8192 |         res = strstr(sym_name, ".llvm.");
|       |             ^
| libbpf.c: In function ‘avail_kallsyms_cb’:
| libbpf.c:11497:31: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
| 11497 |                 if (!(sym_sfx = strstr(sym_name, ".llvm.")))
|       |                               ^
| libbpf.c: In function ‘resolve_full_path’:
| libbpf.c:12085:35: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
| 12085 |                         next_path = strchr(s, ':');
|       |

---
v2: Update Upstream-status form

 .../bpftool/bpftool-native_6.16.bb            |  5 +-
 ...-Fix-Wdiscarded-qualifiers-under-C23.patch | 69 +++++++++++++++++++
 2 files changed, 73 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-kernel/bpftool/bpftool/0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch
meta-oe/recipes-kernel/bpftool/bpftool-native_6.16.bb +4 -1
index fe3ad6138e..edc635517a 100644
@@ -9,7 +9,10 @@ DEPENDS = "binutils-native elfutils-native"
 
 inherit native bash-completion
 
-SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v6.x/linux-${PV}.tar.xz"
+SRC_URI = "\
+    ${KERNELORG_MIRROR}/linux/kernel/v6.x/linux-${PV}.tar.xz \
+    file://0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch \
+"
 SRC_URI[sha256sum] = "1a4be2fe6b5246aa4ac8987a8a4af34c42a8dd7d08b46ab48516bcc1befbcd83"
 
 S = "${UNPACKDIR}/linux-${PV}"
meta-oe/recipes-kernel/bpftool/bpftool/0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch new file +69 -0

69 lines not on this page · raw message

Signature · 1 line
2.34.1