diff mbox series

[meta-ti,master,1/2] linux-ti-staging_6.12: Backport C23 compile fix from linux-stable

Message ID 20260316171305.3378319-1-reatmon@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,master,1/2] linux-ti-staging_6.12: Backport C23 compile fix from linux-stable | expand

Commit Message

Ryan Eatmon March 16, 2026, 5:13 p.m. UTC
A recent change in oe-core [1] to glibc 2.43 has introduced a build
error with 6.12 kernels.  Backport a patch [2] from linux-stable to
address this.

[1] https://git.openembedded.org/openembedded-core/commit/?id=f791d6c52870f3571e740ff7818d45bb0a717934
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=3dedeeecd1ae42a751721d83dc21877122cc1795

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
 ...-Fix-Wdiscarded-qualifiers-under-C23.patch | 60 +++++++++++++++++++
 .../linux/linux-ti-staging_6.12.bb            |  2 +
 2 files changed, 62 insertions(+)
 create mode 100644 meta-ti-bsp/recipes-kernel/linux/files/0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch

Comments

PRC Automation March 16, 2026, 5:25 p.m. UTC | #1
meta-ti / na / 20260316171305.3378319-1-reatmon

PRC Results: PASS

=========================================================
  check-yocto-patches: PASS
=========================================================
Patches
----------------------------------------
All patches passed



=========================================================
  apply-yocto-patch: PASS
=========================================================
master
=====================
Summary:
- Patch Series: [meta-ti][master][PATCH 1/2] linux-ti-staging_6.12: Backport C23 compile fix from linux-stable
- Submitter: From: Ryan Eatmon <reatmon@ti.com>
+From: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
- Date: Date: Mon, 16 Mar 2026 12:13:01 -0500
+Date: Sat, 6 Dec 2025 14:28:25 +0500
- Num Patches: 2
- Mailing List (public inbox) Commit SHA: 749689a70459855e66496a35ce68485f5b88a276

Applied to:
- Repository: lcpd-prc-meta-ti
- Base Branch: master-next
- Commit Author: LCPD Automation Script <lcpdbld@list.ti.com>
- Commit Subject: CI/CD Auto-Merger: cicd.master.202603160400
- Commit SHA: dccc25fd429c27516a2cc0cba3a0ef03b2826d82

Patches
----------------------------------------
All patches applied



=========================================================
  check-yocto-repo: PASS
=========================================================
master
=====================
PASS



=========================================================
  yocto-check-layers: PASS
=========================================================
master - PASS
=====================
All checks passed
diff mbox series

Patch

diff --git a/meta-ti-bsp/recipes-kernel/linux/files/0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch b/meta-ti-bsp/recipes-kernel/linux/files/0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch
new file mode 100644
index 00000000..b7a81006
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/files/0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch
@@ -0,0 +1,60 @@ 
+From 3dedeeecd1ae42a751721d83dc21877122cc1795 Mon Sep 17 00:00:00 2001
+From: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
+Date: Sat, 6 Dec 2025 14:28:25 +0500
+Subject: libbpf: Fix -Wdiscarded-qualifiers under C23
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit d70f79fef65810faf64dbae1f3a1b5623cdb2345 upstream.
+
+glibc ≥ 2.42 (GCC 15) defaults to -std=gnu23, which promotes
+-Wdiscarded-qualifiers to an error.
+
+In C23, strstr() and strchr() return "const char *".
+
+Change variable types to const char * where the pointers are never
+modified (res, sym_sfx, next_path).
+
+Suggested-by: Florian Weimer <fweimer@redhat.com>
+Suggested-by: Andrii Nakryiko <andrii@kernel.org>
+Signed-off-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
+Link: https://lore.kernel.org/r/20251206092825.1471385-1-mikhail.v.gavrilov@gmail.com
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+[ shung-hsi.yu: needed to fix kernel build failure due to libbpf since glibc
+  2.43+ (which adds 'const' qualifier to strstr). 'sym_sfx' hunk dropped because
+  commit f8a05692de06 ("libbpf: Work around kernel inconsistently stripping
+  '.llvm.' suffix") is not present. ]
+Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+Upstream-Status: Backport
+---
+ tools/lib/bpf/libbpf.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
+index 060aecf60b76b1..7d496f0a9a30d1 100644
+--- a/tools/lib/bpf/libbpf.c
++++ b/tools/lib/bpf/libbpf.c
+@@ -8174,7 +8174,7 @@ static int kallsyms_cb(unsigned long long sym_addr, char sym_type,
+ 	struct bpf_object *obj = ctx;
+ 	const struct btf_type *t;
+ 	struct extern_desc *ext;
+-	char *res;
++	const char *res;
+ 
+ 	res = strstr(sym_name, ".llvm.");
+ 	if (sym_type == 'd' && res)
+@@ -11959,7 +11959,7 @@ static int resolve_full_path(const char *file, char *result, size_t result_sz)
+ 		if (!search_paths[i])
+ 			continue;
+ 		for (s = search_paths[i]; s != NULL; s = strchr(s, ':')) {
+-			char *next_path;
++			const char *next_path;
+ 			int seg_len;
+ 
+ 			if (s[0] == ':')
+-- 
+cgit 1.2.3-korg
+
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb
index a02b90e7..c63d7532 100644
--- a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb
+++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb
@@ -24,6 +24,8 @@  BRANCH ?= "ti-linux-6.12.y"
 SRCREV ?= "da3c0f0a33ac00f7138c695a16d90301cf7ec02b"
 PV = "6.12.57+git"
 
+SRC_URI += "file://0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch"
+
 KERNEL_REPRODUCIBILITY_PATCHES = " \
     file://0001-drivers-gpu-drm-msm-registers-improve-reproducibilit.patch \
 "