[OpenWrt-Devel] [PATCH] busybox: fix build with musl 1.2.0

Rosen Penev rosenp at gmail.com
Fri Mar 20 19:45:06 EDT 2020


The SYS_settimeofday is no longer present. That is, it's replaced with the
time32 variant. There is no time64 variant.

Note that 5a7c064bdbb71bfbcded073c7c0a8723be306009 switched the patch to
use the syscall instead of the function as the function expects the
timezone argument to be non-null.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 interestingly enough, musl returns clock_settime in the settimeofday
 function. There's a clock_settime64 syscall.
 package/utils/busybox/Makefile                      | 2 +-
 package/utils/busybox/patches/250-date-k-flag.patch | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index 01441d1e87..baf375eb13 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
 PKG_VERSION:=1.31.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/package/utils/busybox/patches/250-date-k-flag.patch b/package/utils/busybox/patches/250-date-k-flag.patch
index 5aadbb233c..b80d402387 100644
--- a/package/utils/busybox/patches/250-date-k-flag.patch
+++ b/package/utils/busybox/patches/250-date-k-flag.patch
@@ -69,7 +69,7 @@
 +
 +		/* workaround warp_clock() on first invocation */
 +		memset(&tz, 0, sizeof(tz));
-+		syscall(SYS_settimeofday, NULL, &tz);
++		syscall(SYS_settimeofday_time32, NULL, &tz);
 +
 +		memset(&tz, 0, sizeof(tz));
 +#ifdef __USE_MISC
@@ -78,7 +78,7 @@
 +		tz.tz_minuteswest = -(tm_time.__tm_gmtoff / 60);
 +#endif
 +
-+		if (syscall(SYS_settimeofday, NULL, &tz))
++		if (syscall(SYS_settimeofday_time32, NULL, &tz))
 +		{
 +			bb_perror_msg("can't set kernel time zone");
 +			return EXIT_FAILURE;
-- 
2.24.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list