From f20249d4a762258efa794bfbaab1c8fb2a8ea459 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 10 Apr 2024 11:40:56 +0200 Subject: busybox: fix hwclock compile with musl, from busybox ml --- package/busybox/patches/002-hwclock-musl.patch | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 package/busybox/patches/002-hwclock-musl.patch (limited to 'package/busybox') diff --git a/package/busybox/patches/002-hwclock-musl.patch b/package/busybox/patches/002-hwclock-musl.patch new file mode 100644 index 000000000..a5b9ff50d --- /dev/null +++ b/package/busybox/patches/002-hwclock-musl.patch @@ -0,0 +1,31 @@ +diff -Nur busybox-1.36.1.orig/util-linux/hwclock.c busybox-1.36.1/util-linux/hwclock.c +--- busybox-1.36.1.orig/util-linux/hwclock.c 2021-01-01 11:52:27.000000000 +0100 ++++ busybox-1.36.1/util-linux/hwclock.c 2024-04-10 11:18:06.569673535 +0200 +@@ -136,10 +136,24 @@ + * because "it's deprecated by POSIX, therefore it's fine + * if we gratuitously break stuff" :( + */ +-#if !defined(SYS_settimeofday) && defined(SYS_settimeofday_time32) +-# define SYS_settimeofday SYS_settimeofday_time32 +-#endif ++# if !defined(SYS_settimeofday) && defined(SYS_settimeofday_time32) ++# define SYS_settimeofday SYS_settimeofday_time32 ++# endif ++# if defined(SYS_settimeofday) + int ret = syscall(SYS_settimeofday, NULL, tz); ++# else ++ /* Some new architectures have neither settimeofday nor ++ * settimeofday_time32, and the whole kernel timezone handling appears ++ * to have been dropped due to some oddities in the API. See: ++ * ++ * - glibc's commit c3f9aef063 ("Use clock_settime to implement settimeofday.") ++ * - https://github.com/systemd/systemd/issues/13305 ++ * - https://inbox.sourceware.org/libc-alpha/cb015d0d1d29e4b948c7118c5b12ff2bed83a6ec.1561421042.git.alistair.francis@wdc.com/ ++ * ++ * So instead just silently drop these calls. ++ */ ++ int ret = -ENOSYS; ++# endif + #else + int ret = settimeofday(NULL, tz); + #endif -- cgit v1.2.3