diff mbox series

[meta-oe] ostree: Fix build with C23/glibc-2.43

Message ID 20260409233451.2555380-1-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe] ostree: Fix build with C23/glibc-2.43 | expand

Commit Message

Khem Raj April 9, 2026, 11:34 p.m. UTC
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 ...x-const-correctness-of-slash-pointer.patch | 29 +++++++++++++++++++
 .../recipes-extended/ostree/ostree_2025.7.bb  |  1 +
 2 files changed, 30 insertions(+)
 create mode 100644 meta-oe/recipes-extended/ostree/ostree/0001-trivial-httpd-Fix-const-correctness-of-slash-pointer.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/ostree/ostree/0001-trivial-httpd-Fix-const-correctness-of-slash-pointer.patch b/meta-oe/recipes-extended/ostree/ostree/0001-trivial-httpd-Fix-const-correctness-of-slash-pointer.patch
new file mode 100644
index 0000000000..cc0c3d1318
--- /dev/null
+++ b/meta-oe/recipes-extended/ostree/ostree/0001-trivial-httpd-Fix-const-correctness-of-slash-pointer.patch
@@ -0,0 +1,29 @@ 
+From 3b8255e24d0785d6049d473471da53b0c5fd52c1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Thu, 9 Apr 2026 16:28:07 -0700
+Subject: [PATCH] trivial-httpd: Fix const-correctness of slash pointer
+
+strrchr() returns a 'const char *' when passed a 'const char *'
+argument. Declare the local 'slash' variable as 'const char *'
+to match, fixing a build failure with clang when
+-Werror,-Wincompatible-pointer-types-discards-qualifiers is active.
+
+Upstream-Status: Submitted [https://github.com/ostreedev/ostree/pull/3579]
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ src/ostree/ostree-trivial-httpd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ostree/ostree-trivial-httpd.c b/src/ostree/ostree-trivial-httpd.c
+index 4a0c6b00..b5a52e61 100644
+--- a/src/ostree/ostree-trivial-httpd.c
++++ b/src/ostree/ostree-trivial-httpd.c
+@@ -281,7 +281,7 @@ do_get (OtTrivialHttpd *self, SoupServer *server, SoupServerMessage *msg, const
+ do_get (OtTrivialHttpd *self, SoupServer *server, SoupServerMessage *msg, const char *path)
+ #endif
+ {
+-  char *slash;
++  const char *slash;
+   int ret;
+   struct stat stbuf;
+
diff --git a/meta-oe/recipes-extended/ostree/ostree_2025.7.bb b/meta-oe/recipes-extended/ostree/ostree_2025.7.bb
index a2094f68c3..363210b452 100644
--- a/meta-oe/recipes-extended/ostree/ostree_2025.7.bb
+++ b/meta-oe/recipes-extended/ostree/ostree_2025.7.bb
@@ -21,6 +21,7 @@  DEPENDS = " \
 GITHUB_BASE_URI = "https://github.com/ostreedev/ostree/releases"
 SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/libostree-${PV}.tar.xz \
            file://run-ptest \
+           file://0001-trivial-httpd-Fix-const-correctness-of-slash-pointer.patch \
            "
 SRC_URI[sha256sum] = "af8d080b9585e7fd1faba8f022967e1c268ae62e20ecf32ee7b364c1e307570b"