summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2024-04-10 11:40:56 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2024-04-10 11:40:56 +0200
commitf20249d4a762258efa794bfbaab1c8fb2a8ea459 (patch)
treefa693d909a1b1380871c75ce7662c657af10783d /package
parentaba7df786570adb858b11260fd371c162a80668c (diff)
busybox: fix hwclock compile with musl, from busybox ml
Diffstat (limited to 'package')
-rw-r--r--package/busybox/patches/002-hwclock-musl.patch31
1 files changed, 31 insertions, 0 deletions
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