mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-05-08 05:29:22 +00:00
taisei: Fix build with glibc 2.43 + c23
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
+56
@@ -0,0 +1,56 @@
|
||||
From d0326cd89b01600a6d8ba5e32e8e090f2ea29f2d Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <khem.raj@oss.qualcomm.com>
|
||||
Date: Wed, 15 Apr 2026 16:28:28 -0700
|
||||
Subject: [PATCH] misc: fix discarded const qualifiers in char pointer
|
||||
assignments
|
||||
|
||||
These show up with glibc 2.43 + clang-22, glibc-2.43 has C23 versions
|
||||
of str* mem* functions
|
||||
|
||||
Upstream-Status: Backport [https://github.com/taisei-project/taisei/commit/1c8f773912cbbd72b4a4df271fda1bd6d2aeb27f]
|
||||
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
|
||||
---
|
||||
src/log.c | 2 +-
|
||||
src/pixmap/pixmap.c | 2 +-
|
||||
src/vfs/pathutil.c | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/log.c b/src/log.c
|
||||
index 8194535a..88f34386 100644
|
||||
--- a/src/log.c
|
||||
+++ b/src/log.c
|
||||
@@ -161,7 +161,7 @@ static void add_debug_info(StringBuffer *buf) {
|
||||
static size_t modname(const char *filename, size_t filename_len, char *mod) {
|
||||
size_t mlen = filename_len;
|
||||
|
||||
- char *dot = memchr(filename, '.', mlen);
|
||||
+ const char *dot = memchr(filename, '.', mlen);
|
||||
if(dot) {
|
||||
mlen = dot - filename;
|
||||
}
|
||||
diff --git a/src/pixmap/pixmap.c b/src/pixmap/pixmap.c
|
||||
index 25105215..9717f22a 100644
|
||||
--- a/src/pixmap/pixmap.c
|
||||
+++ b/src/pixmap/pixmap.c
|
||||
@@ -49,7 +49,7 @@ void *pixmap_alloc_buffer_for_conversion(const Pixmap *src, PixmapFormat format,
|
||||
}
|
||||
|
||||
static PixmapFileFormatHandler *pixmap_handler_for_filename(const char *file) {
|
||||
- char *ext = strrchr(file, '.');
|
||||
+ const char *ext = strrchr(file, '.');
|
||||
|
||||
if(!ext || !*(++ext)) {
|
||||
return NULL;
|
||||
diff --git a/src/vfs/pathutil.c b/src/vfs/pathutil.c
|
||||
index f6bd6a80..85ccf5ee 100644
|
||||
--- a/src/vfs/pathutil.c
|
||||
+++ b/src/vfs/pathutil.c
|
||||
@@ -14,7 +14,7 @@ char *vfs_path_normalize(const char *path, char *out) {
|
||||
const char *p = path;
|
||||
char *o = out;
|
||||
char *last_sep = out - 1;
|
||||
- char *path_end = strchr(path, 0);
|
||||
+ const char *path_end = strchr(path, 0);
|
||||
|
||||
#define IS_SEP_OR_NUL(chr) (VFS_IS_PATH_SEPARATOR(chr) || (chr == '\0'))
|
||||
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
From c9c00a88c10db4ce93ffcc043c661727d2ec9758 Mon Sep 17 00:00:00 2001
|
||||
From: laochailan <239670+laochailan@users.noreply.github.com>
|
||||
Date: Fri, 13 Feb 2026 20:21:44 -0500
|
||||
Subject: [PATCH] vfs: avoid unnecessary recursion in vfs_mkparents
|
||||
|
||||
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
|
||||
Upstream-Status: Backport [https://github.com/taisei-project/taisei/commit/f2e074f4a6aecf78b980014ed98f12fc6ddfd016]
|
||||
---
|
||||
src/vfs/public.c | 43 +++++++++++++++++--------------------------
|
||||
1 file changed, 17 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/src/vfs/public.c b/src/vfs/public.c
|
||||
index abaa050f..cfeef83a 100644
|
||||
--- a/src/vfs/public.c
|
||||
+++ b/src/vfs/public.c
|
||||
@@ -146,38 +146,29 @@ void vfs_mkdir_required(const char *path) {
|
||||
}
|
||||
}
|
||||
|
||||
-static bool vfs_mkparents_recurse(const char *path) {
|
||||
- // FIXME this has stupid space complexity and is probably silly in general; optimize if you care
|
||||
-
|
||||
- char *psep = strrchr(path, VFS_PATH_SEPARATOR);
|
||||
-
|
||||
- if(!psep) {
|
||||
- // parent is root
|
||||
- return true;
|
||||
- }
|
||||
+bool vfs_mkparents(const char *path) {
|
||||
+ char p[strlen(path)+1];
|
||||
+ path = vfs_path_normalize(path, p);
|
||||
|
||||
- char p[strlen(path) + 1];
|
||||
- strcpy(p, path);
|
||||
- psep += p - path;
|
||||
- *psep = 0;
|
||||
+ // loop over all parent directories
|
||||
+ char *psep = p;
|
||||
+ while((psep = strchr(psep, VFS_PATH_SEPARATOR))) {
|
||||
+ *psep = 0;
|
||||
|
||||
- VFSInfo i = vfs_query(p);
|
||||
+ VFSInfo i = vfs_query(p);
|
||||
+ if(i.error) {
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
- if(i.error) {
|
||||
- return false;
|
||||
- }
|
||||
+ if(!i.exists || !i.is_dir) {
|
||||
+ vfs_mkdir(p);
|
||||
+ }
|
||||
|
||||
- if(i.exists) {
|
||||
- return i.is_dir;
|
||||
+ *psep = VFS_PATH_SEPARATOR;
|
||||
+ psep++;
|
||||
}
|
||||
|
||||
- return vfs_mkparents_recurse(p) && vfs_mkdir(p);
|
||||
-}
|
||||
-
|
||||
-bool vfs_mkparents(const char *path) {
|
||||
- char p[strlen(path)+1];
|
||||
- path = vfs_path_normalize(path, p);
|
||||
- return vfs_mkparents_recurse(p);
|
||||
+ return true;
|
||||
}
|
||||
|
||||
char* vfs_repr(const char *path, bool try_syspath) {
|
||||
@@ -20,7 +20,10 @@ DEPENDS = "\
|
||||
DEPENDS:append:libc-musl = " libucontext"
|
||||
LDFLAGS:append:libc-musl = " -lucontext"
|
||||
|
||||
SRC_URI = "gitsm://github.com/taisei-project/taisei.git;branch=v1.4.x;protocol=https;tag=v${PV}"
|
||||
SRC_URI = "gitsm://github.com/taisei-project/taisei.git;branch=v1.4.x;protocol=https;tag=v${PV} \
|
||||
file://0001-misc-fix-discarded-const-qualifiers-in-char-pointer-.patch \
|
||||
file://0001-vfs-avoid-unnecessary-recursion-in-vfs_mkparents.patch \
|
||||
"
|
||||
SRCREV = "6a484e6e61cc51a22a9943762dc2ff6883914f38"
|
||||
|
||||
inherit features_check meson mime mime-xdg pkgconfig
|
||||
|
||||
Reference in New Issue
Block a user