From patchwork Sun Mar 22 17:13:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1259699 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; 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=XSHRrF89; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48lkcN4St5z9sPk for ; Mon, 23 Mar 2020 04:13:23 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 938C78648C; Sun, 22 Mar 2020 17:13:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J_wc39Cu8y07; Sun, 22 Mar 2020 17:13:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 32F6286422; Sun, 22 Mar 2020 17:13:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0B5BE1BF41F for ; Sun, 22 Mar 2020 17:13:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 059AB86DF4 for ; Sun, 22 Mar 2020 17:13:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FFDTSEoeyaRP for ; Sun, 22 Mar 2020 17:13:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by whitealder.osuosl.org (Postfix) with ESMTPS id 951D486DEA for ; Sun, 22 Mar 2020 17:13:15 +0000 (UTC) Received: by mail-qt1-f181.google.com with SMTP id 10so9673726qtp.1 for ; Sun, 22 Mar 2020 10:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5zUMdl1NFadLsMG+E2cl45znfhZSlQjMvYODMpN7+JE=; b=XSHRrF89ioOhF8ynuAu1AB3dVli97n+ZOFQkCTYqS2V/XMyUhJFrBn/NudAYymeY4H Wh7VKRLkRBhkC+JNRMsV2YV20XfxEGNN2xZEQFboQizcPS+RujpybhYv1Lsv9ea57zUn 3ijQ3kf6+QwjwfptCPp7ByQiZK1bVraaOQill4WeievgT4JaCXisjVYWUsCODdjm0xpu jlXEZUmM2h/leumW8SjjGJxNbe0JDipUEjB00Em15MuwfMO9Xr+7oVRyNeKpo5wyx4ip xD1TbVUsvUXZbQRnssrmlFtF6buUSKzzANxd88xzdsp7GwDQSoWBnhWqFpwbB23TDRlN KnWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5zUMdl1NFadLsMG+E2cl45znfhZSlQjMvYODMpN7+JE=; b=aQYA3MHL64O7V//02Nu2gqCiGujL4+5Uf0awDYcvV2QzJD6DOLoZA/nOB0F1kQ8rex ZIITzGi/B6PWKibpKV+5e4YKgkKXbKfMI9dMY78fRBBbkJQaxxqIHYpYxJuL8+Wayv6M 8AeJmEhXyl/RrqMwRRnrq/rgmDRFCAnZny955rpHZomeX0z+seGpmPNHCMSPo8WO8aj/ pJIfJXOIZXNsfwOptBaQ82hF6WPbdNK/jYu6/rctbE7eZ+EFNIc+A+oUAzIPXCEvve9s d5PiSLvjEzDJjrAOXpbp4xa9G1Tb6LN+VIzA7rOIzNMaHofl6Eae/Wi0gjpCZGrQ5Reh 62ig== X-Gm-Message-State: ANhLgQ3EmK1OE8Wn4v+6inW4zNYVisASwk3fp/BZrssILtT9YYcKPqyR YtOR2qo9Rfd0/Chis5hTk7HUeVWWmvw= X-Google-Smtp-Source: ADFU+vtO1FRCxBNacO02F4hYvZNpueNlB2hQxsiENVWe4vYGgWqQBCQ3hzGU9ry7RDDV7s+akc/ucg== X-Received: by 2002:ac8:23ed:: with SMTP id r42mr4686865qtr.372.1584897194410; Sun, 22 Mar 2020 10:13:14 -0700 (PDT) Received: from casantos.remote.com (189.27.250.150.dynamic.adsl.gvt.net.br. [189.27.250.150]) by smtp.gmail.com with ESMTPSA id u13sm9512865qtg.64.2020.03.22.10.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:13:13 -0700 (PDT) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Sun, 22 Mar 2020 14:13:01 -0300 Message-Id: <20200322171301.15753-3-unixmania@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200322171301.15753-1-unixmania@gmail.com> References: <20200322171301.15753-1-unixmania@gmail.com> Subject: [Buildroot] [PATCH v6 2/2] package/busybox: fix build with glibc 2.31 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlos Santos , Romain Naour , arc-buildroot@synopsys.com, "Yann E . MORIN ." , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos Busybox 1.31.1 fails to build with glibc 2.31 due to the removal of stime() from glibc. Pull a patch already applied upstream to fix the problem. The patch was rebased on version 1.31.1 to minimize the change, since the original one depended on a previous commit which is not worthwhile to pick. Signed-off-by: Evgeniy Didin Signed-off-by: Carlos Santos Cc: Romain Naour Cc: Thomas Petazzoni Cc: Yann E. MORIN. Cc: arc-buildroot@synopsys.com --- Supersedes: https://patchwork.ozlabs.org/patch/1259554/ --- Changes v6: - Use 5 separate patches from upstream and split the Buildroot fix into two, one for the musl compatibility and other for the glibc, as suggested by Yann E. MORIN.. Changes v5: - Drop the first patch, squash the other ones and rebase on v1.31.1, as suggested by Romain Naour Changes v4: - Rabase on the master branch - Add SOB lines to patches --- .../0007-Remove-stime-function-calls.patch | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 package/busybox/0007-Remove-stime-function-calls.patch diff --git a/package/busybox/0007-Remove-stime-function-calls.patch b/package/busybox/0007-Remove-stime-function-calls.patch new file mode 100644 index 0000000000..58e1ced3de --- /dev/null +++ b/package/busybox/0007-Remove-stime-function-calls.patch @@ -0,0 +1,97 @@ +From 59102e499ac25c4311246d2b9417b3e5830cf851 Mon Sep 17 00:00:00 2001 +From: Alistair Francis +Date: Tue, 19 Nov 2019 13:06:40 +0100 +Subject: [PATCH] Remove stime() function calls + +stime() has been deprecated in glibc 2.31 and replaced with +clock_settime(). Let's replace the stime() function calls with +clock_settime() in preperation. + +function old new delta +rdate_main 197 224 +27 +clock_settime - 27 +27 +date_main 926 941 +15 +stime 37 - -37 +------------------------------------------------------------------------------ +(add/remove: 2/2 grow/shrink: 2/0 up/down: 69/-37) Total: 32 bytes + +Signed-off-by: Alistair Francis +Signed-off-by: Denys Vlasenko + +(cherry picked from commit d3539be8f27b8cbfdfee460fe08299158f08bcd9) + +Signed-off-by: Carlos Santos +--- + coreutils/date.c | 6 +++++- + libbb/missing_syscalls.c | 8 -------- + util-linux/rdate.c | 8 ++++++-- + 3 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/coreutils/date.c b/coreutils/date.c +index e479c23a2..77a7d1368 100644 +--- a/coreutils/date.c ++++ b/coreutils/date.c +@@ -276,6 +276,9 @@ int date_main(int argc UNUSED_PARAM, char **argv) + time(&ts.tv_sec); + #endif + } ++#if !ENABLE_FEATURE_DATE_NANO ++ ts.tv_nsec = 0; ++#endif + localtime_r(&ts.tv_sec, &tm_time); + + /* If date string is given, update tm_time, and maybe set date */ +@@ -298,9 +301,10 @@ int date_main(int argc UNUSED_PARAM, char **argv) + if (date_str[0] != '@') + tm_time.tm_isdst = -1; + ts.tv_sec = validate_tm_time(date_str, &tm_time); ++ ts.tv_nsec = 0; + + /* if setting time, set it */ +- if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) { ++ if ((opt & OPT_SET) && clock_settime(CLOCK_REALTIME, &ts) < 0) { + bb_perror_msg("can't set date"); + } + } +diff --git a/libbb/missing_syscalls.c b/libbb/missing_syscalls.c +index 87cf59b3d..dc40d9155 100644 +--- a/libbb/missing_syscalls.c ++++ b/libbb/missing_syscalls.c +@@ -15,14 +15,6 @@ pid_t getsid(pid_t pid) + return syscall(__NR_getsid, pid); + } + +-int stime(const time_t *t) +-{ +- struct timeval tv; +- tv.tv_sec = *t; +- tv.tv_usec = 0; +- return settimeofday(&tv, NULL); +-} +- + int sethostname(const char *name, size_t len) + { + return syscall(__NR_sethostname, name, len); +diff --git a/util-linux/rdate.c b/util-linux/rdate.c +index 70f829e7f..878375d78 100644 +--- a/util-linux/rdate.c ++++ b/util-linux/rdate.c +@@ -95,9 +95,13 @@ int rdate_main(int argc UNUSED_PARAM, char **argv) + if (!(flags & 2)) { /* no -p (-s may be present) */ + if (time(NULL) == remote_time) + bb_error_msg("current time matches remote time"); +- else +- if (stime(&remote_time) < 0) ++ else { ++ struct timespec ts; ++ ts.tv_sec = remote_time; ++ ts.tv_nsec = 0; ++ if (clock_settime(CLOCK_REALTIME, &ts) < 0) + bb_perror_msg_and_die("can't set time of day"); ++ } + } + + if (flags != 1) /* not lone -s */ +-- +2.18.2 +