From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 dcvr.yhbt.net (Postfix) with ESMTPS id 48EAA1F55B for ; Sun, 24 May 2020 09:03:49 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 20AD63851C0B; Sun, 24 May 2020 09:03:48 +0000 (GMT) Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) by sourceware.org (Postfix) with ESMTPS id 5B5703851C05 for ; Sun, 24 May 2020 09:03:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5B5703851C05 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49VDmF2KYxz1rs00; Sun, 24 May 2020 11:03:41 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49VDmD6X9nz1qrhv; Sun, 24 May 2020 11:03:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id UGkcY_7UJByu; Sun, 24 May 2020 11:03:39 +0200 (CEST) X-Auth-Info: LYKdPP6PGdwJkbwOPN22JE9NUkVrvTpz8L7NNrRpPQQ= Received: from jawa (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sun, 24 May 2020 11:03:39 +0200 (CEST) Date: Sun, 24 May 2020 11:03:38 +0200 From: Lukasz Majewski To: "H.J. Lu" Subject: Re: [PATCH] Fix __clock_gettime64 for sysdeps/generic/hp-timing.h Message-ID: <20200524110338.0165621c@jawa> In-Reply-To: References: <20200505181605.22346-1-lukma@denx.de> <20200521122423.7d98dd96@jawa> Organization: denx.de X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/I9p1ak10dd1WbrJlkSaZ_cL"; protocol="application/pgp-signature" X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Weimer , GNU C Library , Andreas Schwab , Alistair Francis , Joseph Myers Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --Sig_/I9p1ak10dd1WbrJlkSaZ_cL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, 23 May 2020 13:32:05 -0700 "H.J. Lu" wrote: > On Thu, May 21, 2020 at 4:11 AM H.J. Lu wrote: > > > > On Thu, May 21, 2020 at 3:24 AM Lukasz Majewski > > wrote: =20 > > > > > > Hi "H.J. Lu", > > > =20 > > > > On Tue, May 5, 2020 at 11:21 AM Lukasz Majewski > > > > wrote: =20 > > > > > > > > > > The __clock_gettime internal function is not supporting 64 > > > > > bit time on architectures with __WORDSIZE =3D=3D 32 and > > > > > __TIMESIZE !=3D 64 (like e.g. ARM 32 bit). > > > > > > > > > > The __clock_gettime64 function shall be used instead in the > > > > > glibc itself as it supports 64 bit time on those systems. > > > > > This patch does not bring any changes to systems with > > > > > __WORDSIZE =3D=3D 64 as for them the __clock_gettime64 is aliased > > > > > to __clock_gettime (in ./include/time.h). > > > > > > > > > > --- > > > > > Changes for v3: > > > > > - Fix the commit message (add missing "function" after > > > > > __clock_gettime64) > > > > > - Refactor __nisfind_server() function to support 64 bit time > > > > > with struct timespec instead of struct timeval > > > > > - Change expires to __time64_t > > > > > > > > > > Changes for v2: > > > > > - Use only TIMESPEC_TO_TIMEVAL instead of > > > > > valid_timespec64_to_timeval in logout.c and logwtmp.c as it is > > > > > generic enough to also support struct __timespec64 conversion > > > > > to struct timeval --- > > > > > benchtests/bench-timing.h | 2 +- > > > > > include/random-bits.h | 4 ++-- > > > > > login/logout.c | 4 ++-- > > > > > login/logwtmp.c | 5 +++-- > > > > > nis/nis_call.c | 16 > > > > > +++++++--------- sysdeps/generic/hp-timing.h > > > > > | 4 ++-- sysdeps/generic/memusage.h > > > > > | 4 ++-- sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c | > > > > > 4 ++-- sysdeps/unix/sysv/linux/clock.c | 7 > > > > > ++----- 9 files changed, 23 insertions(+), 27 deletions(-) > > > > > =20 > > > > > > > > Does this patch work with "make bench" when > > > > sysdeps/generic/hp-timing.h is used, like on arm? I got > > > > In file included from ./bench-timing.h:23, > > > > from ./bench-skeleton.c:25, > > > > from > > > > /export/build/gnu/tools-build/glibc-gitlab/build-x86_64-linux/bench= tests/bench-rint.c:45: > > > > ./bench-skeleton.c: In function =E2=80=98main=E2=80=99: > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > =E2=80=98tv=E2=80=99 isn=E2=80=99t known 37 | struct __timespec64= tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 82 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:38:3: error: implicit > > > > declaration of function =E2=80=98__clock_gettime64=E2=80=99; did yo= u mean > > > > =E2=80=98clock_gettime=E2=80=99? [-Werror=3Dimplicit-function-decla= ration] > > > > 38 | __clock_gettime64 (CLOCK_MONOTONIC, &tv); \ > > > > | ^~~~~~~~~~~~~~~~~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 82 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > =E2=80=98tv=E2=80=99 [-Werror=3Dunused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 82 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > =E2=80=98tv=E2=80=99 isn=E2=80=99t known 37 | struct __timespec64= tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:86:8: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 86 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > =E2=80=98tv=E2=80=99 [-Werror=3Dunused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:86:8: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 86 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > =E2=80=98tv=E2=80=99 isn=E2=80=99t known 37 | struct __timespec64= tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:90:8: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 90 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > =E2=80=98tv=E2=80=99 [-Werror=3Dunused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:90:8: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 90 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > =E2=80=98tv=E2=80=99 isn=E2=80=99t known 37 | struct __timespec64= tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:94:8: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 94 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > =E2=80=98tv=E2=80=99 [-Werror=3Dunused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:94:8: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 94 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > =E2=80=98tv=E2=80=99 isn=E2=80=99t known 37 | struct __timespec64= tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:103:3: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 103 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > =E2=80=98tv=E2=80=99 [-Werror=3Dunused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:103:3: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 103 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > =E2=80=98tv=E2=80=99 isn=E2=80=99t known 37 | struct __timespec64= tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:106:3: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 106 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > =E2=80=98tv=E2=80=99 [-Werror=3Dunused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > =E2=80=98HP_TIMING_NOW=E2=80=99 35 | #define TIMING_NOW(var) HP_TIM= ING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:106:3: note: in expansion of macro > > > > =E2=80=98TIMING_NOW=E2=80=99 106 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > cc1: all warnings being treated as errors =20 > > > > > > How shall I reproduce this error? =20 > > > > Apply the enclosed patch and do > > > > $ make USE_CLOCK_GETTIME=3D1 bench > > =20 > > > Was it supposed to be catch with build-many-glibc.py ? > > > =20 > > > > No, "make bench" isn't tested by build-many-glibc.py. > > =20 >=20 > Here is the patch to fix __clock_gettime64 for > sysdeps/generic/hp-timing.h. OK for master? >=20 Thanks for preparing the fix. If I may ask - I do have some question about the following code: +#else +struct __timespec64; +extern int __clock_gettime64 (clockid_t clock_id, struct __timespec64 *tp); +#endif Why do we need the "struct __timespec64;" declaration there as in ./sysdeps/generic/hp-timing.h you explicitly added: #include ? Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/I9p1ak10dd1WbrJlkSaZ_cL Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl7KOGoACgkQAR8vZIA0 zr3hZQf+KTrTPg4hjF91bqGRAn0xtOWecpb5NrgDy8/Itc6+Sp5lQNxRsthzRZ1K CTeoNV/16O6mNvycdowcTx0zEHhcl/7jm3lFjhlGxgBOkVyDDqgAr/baWPDcmCNt gmTL/vZGeQHO0xxyl4ZDqX7Wneczc3LpCjiSUtOnetavVEnkoE0ozHbFhItVNCOu nZ8ZYSnnbzDwRz+42ia+iAHFROBit8tHCCFNpqmAnoJJrpTxpe+4DFoe0KffluzQ OV3eiyP2fp3bVRUDM6hQ7PqZ/3I4Kq9zf48FujAD8q4pbt2Y5iQOgUtvgrJXgMWp FKDhgsNcCU4M6jtI4r2cfo2NBTF0iQ== =ZySs -----END PGP SIGNATURE----- --Sig_/I9p1ak10dd1WbrJlkSaZ_cL--