From patchwork Mon Jul 20 22:32:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1332659 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=kMDXGPtK; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=mLwHV9Lo; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B9c3112Mjz9sRR for ; Tue, 21 Jul 2020 08:34:05 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=gqtoefwoKFyp6L0OWA+sGV4RdOLECbW6X2ADW5qs+HQ=; b=kMDXGPtKogi6ujoFVj63D/aV4Q RLuavGikcgdZcOL7C2AA0ZPubmUCoANVHQzcipQZrf5cR6u5Fgl+gzpX4qqz8FrSRDXmnxmslqswq rVQkna4Cyvwf473R2WoGsaU9+8g+trlT2qLuvwGAJpKZ+mmsEeliSZjmVypIDZjzgZwWrQcjm4zyI bkYGdYUOFRpljwMxqxm+SMT/yQovYieW4fxr4ETsST0b6Kecb1HfdJYx37QXRLqXCda9ysNq9IQeP wyvPTn7dD0HTBy+1edHUQ7cjJt/RyKshmxBb62lrNzRJqcnAqES10Zufk1cM9a0/QGNlmGeZ1N3ew kOu3mdzA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxeLI-00047c-4v; Mon, 20 Jul 2020 22:33:04 +0000 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxeLE-000461-Hk for openwrt-devel@lists.openwrt.org; Mon, 20 Jul 2020 22:33:01 +0000 Received: by mail-pj1-x1041.google.com with SMTP id a9so585816pjd.3 for ; Mon, 20 Jul 2020 15:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=6UcghaffHCmP1Qu6YYUqgP557hq2Podlg+OJus2Vwgo=; b=mLwHV9LonAfEbK0jbWQUymKmvCubF1BhWpj4CC31xbvnWuzQq61sFpp6aopoLKUexZ nWv3MMnw7v07PTGAfh9UzjJgPfBq9oPAZi/qy3L5EIBF8nBjtR5DTe7G6V/4CmNcKPmK Yh0kqqEDm/1DYoPeiZe0ofeCJviHjbItEedloEu13ZXEmmkvVloQ35uiP1VQsT+CMNwy V+VW7MgEbFjO1wf10yGnMpy5Qg6hvPJ0t+uDvyfnl7DXStwZi541HYWJ+jUQWP448bKA RtlYPY+j0dlMDpRTAiV0rnj+jp36EOBzHILwvbe27YtmTaYVMK77yoQbzCGMysNVxqz+ 2lvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=6UcghaffHCmP1Qu6YYUqgP557hq2Podlg+OJus2Vwgo=; b=hLYsMmELXacPjpwcvLzCNNqsv6RgKsTtLLDLZ6yOJXQ8Lg7tQ5ssXEu8F+ycb7ZpP1 psCBsbT8dPqvs8HT+Vv5dJNFTR7gD6urEHG1G7lT/zT864I/5ADPxNEBggwGmim6kw1y XC8tJ8oumnbaOeeYTNPIPdIUZE/txSPtorh939lBri0rML95Ma2eNQdI57agDZesJWP3 FWKbXaKT3ddbTRIJZDBdf2hoZgGMOViJJOTz0UvoaIxFxMPRm3xIh6cof4A2bHhpkXGr aziK6jRPHD1PBYJD7vRcN6s+f3fPi8NXkfZZKLDrlNjfoHsSwBu4rog+xBflpePndzUm O4jg== X-Gm-Message-State: AOAM530kJ1pFVJ2WqggMgdQq0Jj5pBZZuKg9T2AVD9OfHHFfTRRWTVcI gYiDzcbncn16ohy6M+OWg5qxC5/C X-Google-Smtp-Source: ABdhPJyym5CM7BYEaohSxXBBO5rtQ9s/Evt5IvsBInudWDEYNsZTLxuksur4ovUi6XQNeWb9YgYVUw== X-Received: by 2002:a17:90b:2285:: with SMTP id kx5mr1627678pjb.83.1595284375012; Mon, 20 Jul 2020 15:32:55 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id e20sm17540902pfl.212.2020.07.20.15.32.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2020 15:32:54 -0700 (PDT) From: Rosen Penev To: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/2] busybox: fix build with musl 1.2.0 Date: Mon, 20 Jul 2020 15:32:52 -0700 Message-Id: <20200720223253.80526-1-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200720_183300_654988_35A9B501 X-CRM114-Status: GOOD ( 10.71 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1041 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [rosenp[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org 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 musl's settimeofday does not use the tz argument for anything. Signed-off-by: Rosen Penev --- package/utils/busybox/Makefile | 2 +- .../busybox/patches/250-date-k-flag.patch | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 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..05be9fab8b 100644 --- a/package/utils/busybox/patches/250-date-k-flag.patch +++ b/package/utils/busybox/patches/250-date-k-flag.patch @@ -8,19 +8,21 @@ //usage: "\n" //usage: "\nRecognized TIME formats:" //usage: "\n hh:mm[:ss]" -@@ -139,9 +140,8 @@ +@@ -139,8 +140,11 @@ #include "libbb.h" #include "common_bufsiz.h" -#if ENABLE_FEATURE_DATE_NANO -# include --#endif +#include +#include ++ ++#ifndef SYS_settimeofday ++#define SYS_settimeofday SYS_settimeofday_time32 + #endif enum { - OPT_RFC2822 = (1 << 0), /* R */ -@@ -149,8 +149,9 @@ enum { +@@ -149,8 +153,9 @@ enum { OPT_UTC = (1 << 2), /* u */ OPT_DATE = (1 << 3), /* d */ OPT_REFERENCE = (1 << 4), /* r */ @@ -32,7 +34,7 @@ }; #if ENABLE_LONG_OPTS -@@ -162,6 +163,7 @@ static const char date_longopts[] ALIGN1 +@@ -162,6 +167,7 @@ static const char date_longopts[] ALIGN1 = /* "universal\0" No_argument "u" */ "date\0" Required_argument "d" "reference\0" Required_argument "r" @@ -40,7 +42,7 @@ ; #endif -@@ -181,6 +183,8 @@ static void maybe_set_utc(int opt) +@@ -181,6 +187,8 @@ static void maybe_set_utc(int opt) int date_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int date_main(int argc UNUSED_PARAM, char **argv) { @@ -49,7 +51,7 @@ struct timespec ts; struct tm tm_time; char buf_fmt_dt2str[64]; -@@ -193,7 +197,7 @@ int date_main(int argc UNUSED_PARAM, cha +@@ -193,7 +201,7 @@ int date_main(int argc UNUSED_PARAM, char **argv) char *isofmt_arg = NULL; opt = getopt32long(argv, "^" @@ -58,7 +60,7 @@ IF_FEATURE_DATE_ISOFMT("I::D:") "\0" "d--s:s--d" -@@ -256,6 +260,31 @@ int date_main(int argc UNUSED_PARAM, cha +@@ -256,6 +264,31 @@ int date_main(int argc UNUSED_PARAM, char **argv) if (*argv) bb_show_usage(); From patchwork Mon Jul 20 22:32:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1332660 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=i2JE9THn; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=OXplKw8U; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B9c334y6Kz9sRR for ; Tue, 21 Jul 2020 08:34:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BSF2R4oeF6E5LAF8WZBda1DQQSWwNqmPb34R/2DmJ1I=; b=i2JE9THnIpfDja1/tC3vKnv3+S URYp73ACn8PDSpt03AtqnD05jDBKW5pYSnVvNOhpG5flKzfchbk2VwexTUm/xrkj7xvRmSQYM8t6m 42ELRCh6I+AxrGwbQfYhqY/E8HQM2Vnd917U6WW1tsmIif+wfxTmUGHLK3YScPNjyZM8FF8kpc/Ns ugQpE784FW5EBbFCDf2ayYS4sWngLAlLTu8cSctCydaxGAJQLlAxrx50EnfQxNHzuIte9aSNeOrYi t8d5zg+QkIeTRrqwLahv5qeY0mA0aM/HcR9lHD+/GesYS5lffsC0MLqpPzs7ruEnjCaYU6A7MLYNB Iscdcmdw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxeLF-000478-PU; Mon, 20 Jul 2020 22:33:01 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxeLD-00046A-Qb for openwrt-devel@lists.openwrt.org; Mon, 20 Jul 2020 22:33:00 +0000 Received: by mail-pf1-x444.google.com with SMTP id s26so9770996pfm.4 for ; Mon, 20 Jul 2020 15:32:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=KHoV7Z2zE1kEdMyxNJzwVGPfGaqWvvPT2h7n2fdK5UE=; b=OXplKw8Uo2oaGwwbc3O6jpmgT6iKcmhCsMXk4euYwOGHjG4dvck3WNY6Nj2Bnlwx/t 3jt4VEMqiHfnBEQaPMTTPfFai5TTodkSzSnYoQkQn4cbVMq2/RH4DsUYPyzQdOQ6Btqc vEck6G5+uu+4Bj5+0JGeps0cWhTsmG1+I8cRspeFhErYdVJ6KRyFmgIguGf6PU9re1qv PR9xqSVYkzaQlwCuh/ldp+uOzJo1BwVvK2UpomyqqjsfRssLGFHVGD7hucahjXHmiOM+ 5vSApTRxMVy1cWkirzCra39DI5ZogaomIcfYZ0PyZLLtH6XZl400v/nBw3V6Bj9qG4YE PQ3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KHoV7Z2zE1kEdMyxNJzwVGPfGaqWvvPT2h7n2fdK5UE=; b=LBM9s5X8XKj8VI/VN7IQjlnNgj1oswWuazi5pNjZbKt9nHLA7SJKFfIxGwbye3uLwl sTZuJlv7oJzxjECCm443Hcc9qrZYqT3Ny27nMI+jpfOJZhfpfZOOQibLRWJHu3maL9/W dc4mHsVEmsQ2p8khfwcldyv1GNNiA6Mp0WVM1AUg8+33vzLNhRcdhE41IkcvXe3cnDG5 s0oEGIVTAOVyVFLvyju3X37hAdFMnezJyP/NsAccLosw7fF7rH60W6K60Q/glXJZ8zsl 9ND8sFDDq31tnTuvgz+WQEHOYlV/96zuT5L6wsHDyTFh3OwJ4rUgCc0rdj0/HvgYJc27 LWIA== X-Gm-Message-State: AOAM531TuhiFIWnzKWltav81i3/y2kmIb4Byk4828xpL/CKFky02iTu2 GhYTTCWrm35szPBOKEBRgOwBONz6 X-Google-Smtp-Source: ABdhPJxzClMIRRHPdrazs0I8ZQczD6uOtS56U6tgvy2aafgs5MaxEiQFarjHCGFQ9KwuYaVTvuWkQg== X-Received: by 2002:aa7:968d:: with SMTP id f13mr323868pfk.279.1595284376266; Mon, 20 Jul 2020 15:32:56 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id e20sm17540902pfl.212.2020.07.20.15.32.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2020 15:32:55 -0700 (PDT) From: Rosen Penev To: openwrt-devel@lists.openwrt.org Subject: [PATCH 2/2] busybox: backport extra time patches Date: Mon, 20 Jul 2020 15:32:53 -0700 Message-Id: <20200720223253.80526-2-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200720223253.80526-1-rosenp@gmail.com> References: <20200720223253.80526-1-rosenp@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200720_183259_917058_C1A852FA X-CRM114-Status: GOOD ( 15.31 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [rosenp[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org They fix compilation with musl 1.2.0, which uses 64-bit time_t. Signed-off-by: Rosen Penev --- .../utils/busybox/patches/002-time64.patch | 46 ++++++++++++++++++ .../utils/busybox/patches/003-gettime.patch | 48 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 package/utils/busybox/patches/002-time64.patch create mode 100644 package/utils/busybox/patches/003-gettime.patch diff --git a/package/utils/busybox/patches/002-time64.patch b/package/utils/busybox/patches/002-time64.patch new file mode 100644 index 0000000000..7f8c6bfe5d --- /dev/null +++ b/package/utils/busybox/patches/002-time64.patch @@ -0,0 +1,46 @@ +From 902d3992922fc8db8495d5fb30a4581711b60c62 Mon Sep 17 00:00:00 2001 +From: Alistair Francis +Date: Wed, 18 Sep 2019 09:28:50 -0700 +Subject: time: Use 64 prefix syscall if we have to + +Some 32-bit architectures no longer have the 32-bit time_t syscalls. +Instead they have suffixed syscalls that returns a 64-bit time_t. If +the architecture doesn't have the non-suffixed syscall and is using a +64-bit time_t let's use the suffixed syscall instead. + +This fixes build issues when building for RISC-V 32-bit with 5.1+ kernel +headers. + +If an architecture only supports the suffixed syscalls, but is still +using a 32-bit time_t report a compilation error. This avoids us have to +deal with converting between 64-bit and 32-bit values. There are +currently no architectures where this is the case. + +Signed-off-by: Alistair Francis +Signed-off-by: Denys Vlasenko +--- + libbb/time.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +(limited to 'libbb/time.c') + +diff --git a/libbb/time.c b/libbb/time.c +index cab0ad602..b6fcae28b 100644 +--- a/libbb/time.c ++++ b/libbb/time.c +@@ -257,7 +257,14 @@ char* FAST_FUNC strftime_YYYYMMDDHHMMSS(char *buf, unsigned len, time_t *tp) + * typically requiring -lrt. We just skip all this mess */ + static void get_mono(struct timespec *ts) + { ++#if defined(__NR_clock_gettime) + if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts)) ++#elif __TIMESIZE == 64 ++ if (syscall(__NR_clock_gettime64, CLOCK_MONOTONIC, ts)) ++#else ++# error "We currently don't support architectures without " \ ++ "the __NR_clock_gettime syscall and 32-bit time_t" ++#endif + bb_error_msg_and_die("clock_gettime(MONOTONIC) failed"); + } + unsigned long long FAST_FUNC monotonic_ns(void) + diff --git a/package/utils/busybox/patches/003-gettime.patch b/package/utils/busybox/patches/003-gettime.patch new file mode 100644 index 0000000000..8ad4804179 --- /dev/null +++ b/package/utils/busybox/patches/003-gettime.patch @@ -0,0 +1,48 @@ +From be5a505d771a77c640acc35ceaa470c80e62f954 Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko +Date: Thu, 24 Oct 2019 16:26:55 +0200 +Subject: Remove syscall wrappers around clock_gettime, closes 12091 + +12091 "Direct use of __NR_clock_gettime is not time64-safe". + +function old new delta +runsv_main 1698 1712 +14 +startservice 378 383 +5 +get_mono 31 25 -6 +date_main 932 926 -6 +gettimeofday_ns 17 - -17 +------------------------------------------------------------------------------ +(add/remove: 0/1 grow/shrink: 2/2 up/down: 19/-29) Total: -10 bytes + +Signed-off-by: Denys Vlasenko +--- + libbb/time.c | 11 +---------- + 1 file changed, 1 insertion(+), 10 deletions(-) + +(limited to 'libbb/time.c') + +diff --git a/libbb/time.c b/libbb/time.c +index b6fcae28b..e66a9cba8 100644 +--- a/libbb/time.c ++++ b/libbb/time.c +@@ -253,18 +253,9 @@ char* FAST_FUNC strftime_YYYYMMDDHHMMSS(char *buf, unsigned len, time_t *tp) + #define CLOCK_MONOTONIC 1 + #endif + +-/* libc has incredibly messy way of doing this, +- * typically requiring -lrt. We just skip all this mess */ + static void get_mono(struct timespec *ts) + { +-#if defined(__NR_clock_gettime) +- if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts)) +-#elif __TIMESIZE == 64 +- if (syscall(__NR_clock_gettime64, CLOCK_MONOTONIC, ts)) +-#else +-# error "We currently don't support architectures without " \ +- "the __NR_clock_gettime syscall and 32-bit time_t" +-#endif ++ if (clock_gettime(CLOCK_MONOTONIC, ts)) + bb_error_msg_and_die("clock_gettime(MONOTONIC) failed"); + } + unsigned long long FAST_FUNC monotonic_ns(void) +