diff --git a/meta-oe/recipes-test/libfaketime/libfaketime/0001-Add-const-qualifiers-to-fix-build-with-ISO-C23.patch b/meta-oe/recipes-test/libfaketime/libfaketime/0001-Add-const-qualifiers-to-fix-build-with-ISO-C23.patch new file mode 100644 index 0000000000..1696e7146e --- /dev/null +++ b/meta-oe/recipes-test/libfaketime/libfaketime/0001-Add-const-qualifiers-to-fix-build-with-ISO-C23.patch @@ -0,0 +1,34 @@ +From dbe865dfdba0145d993d70b7fd4ec88b2f47554b Mon Sep 17 00:00:00 2001 +From: Tomas Korbar +Date: Mon, 15 Dec 2025 11:03:21 +0100 +Subject: [PATCH] Add const qualifiers to fix build with ISO C23 + +Fix https://github.com/wolfcw/libfaketime/issues/524 + +Upstream-Status: Backport [https://github.com/wolfcw/libfaketime/pull/525] +--- + src/libfaketime.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/libfaketime.c b/src/libfaketime.c +index ef1dca9..02839c8 100644 +--- a/src/libfaketime.c ++++ b/src/libfaketime.c +@@ -2666,7 +2666,7 @@ int timespec_get(struct timespec *ts, int base) + static void parse_ft_string(const char *user_faked_time) + { + struct tm user_faked_time_tm; +- char * tmp_time_fmt; ++ const char * tmp_time_fmt; + char * nstime_str; + + if (!strncmp(user_faked_time, user_faked_time_saved, BUFFERLEN)) +@@ -3338,7 +3338,7 @@ static void prepare_config_contents(char *contents) + bool str_array_contains(const char *haystack, const char *needle) + { + size_t needle_len = strlen(needle); +- char *pos = strstr(haystack, needle); ++ const char *pos = strstr(haystack, needle); + while (pos) { + if (pos == haystack || *(pos - 1) == ',') { + char nextc = *(pos + needle_len); diff --git a/meta-oe/recipes-test/libfaketime/libfaketime/0001-Makefile-Detect-compiler-in-makefile.patch b/meta-oe/recipes-test/libfaketime/libfaketime/0001-Makefile-Detect-compiler-in-makefile.patch deleted file mode 100644 index ff04837652..0000000000 --- a/meta-oe/recipes-test/libfaketime/libfaketime/0001-Makefile-Detect-compiler-in-makefile.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 735bb5d053efad274aa4ea5a6682e656ff792909 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 24 Aug 2023 01:49:48 -0700 -Subject: [PATCH] Makefile: Detect compiler in makefile - -Add compiler specific options based on detected compiler gcc/clang - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - src/Makefile | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - -diff --git a/src/Makefile b/src/Makefile -index 62e924c..c15eb33 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -110,7 +110,23 @@ PREFIX ?= /usr/local - LIBDIRNAME ?= /lib/faketime - PLATFORM ?=$(shell uname) - --CFLAGS += -std=gnu99 -Wall -Wextra -Werror -Wno-nonnull-compare -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' $(FAKETIME_COMPILE_CFLAGS) -+ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1) -+COMPILER := clang -+else -+COMPILER := gcc -+endif -+export COMPILER -+ -+CFLAGS += -std=gnu99 -Wall -Wextra -Werror -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' $(FAKETIME_COMPILE_CFLAGS) -+ -+ifeq ($(COMPILER),clang) -+CFLAGS += -Wno-tautological-pointer-compare -+endif -+ -+ifeq ($(COMPILER),gcc) -+CFLAGS += -Wno-nonnull-compare -+endif -+ - ifeq ($(PLATFORM),SunOS) - CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 - endif --- -2.42.0 - diff --git a/meta-oe/recipes-test/libfaketime/libfaketime_0.9.10.bb b/meta-oe/recipes-test/libfaketime/libfaketime_0.9.11.bb similarity index 80% rename from meta-oe/recipes-test/libfaketime/libfaketime_0.9.10.bb rename to meta-oe/recipes-test/libfaketime/libfaketime_0.9.11.bb index 3588e96847..55a4cabe81 100644 --- a/meta-oe/recipes-test/libfaketime/libfaketime_0.9.10.bb +++ b/meta-oe/recipes-test/libfaketime/libfaketime_0.9.11.bb @@ -3,19 +3,20 @@ SECTION = "libs" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" -SRCREV = "d475b925943ad404c6c728ac868dc73949e7281c" - -SRC_URI = "git://github.com/wolfcw/libfaketime.git;branch=master;protocol=https \ - file://0001-Makefile-Detect-compiler-in-makefile.patch \ - " +SRCREV = "6714b98794a9e8a413bf90d2927abf5d888ada99" +SRC_URI = "git://github.com/wolfcw/libfaketime.git;branch=master;tag=v${PV};protocol=https \ + file://0001-Add-const-qualifiers-to-fix-build-with-ISO-C23.patch \ +" CFLAGS:append:libc-musl = " -D_LARGEFILE64_SOURCE" do_configure[noexec] = "1" + do_compile () { oe_runmake } + do_install () { install -d ${D}${libdir}/faketime oe_libinstall -C src libfaketime ${D}${libdir}/faketime