Message ID | CAMe9rOppGQG1GV7KZ7g7wr46u8z0O9rBcixOos3vb3o89DHtig@mail.gmail.com |
---|---|
State | Superseded |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CA3DF3851C17; Sat, 23 May 2020 20:32:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA3DF3851C17 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1590265965; bh=cbEiA5rRt3/AFwA55v11QjghUcvGS2AILds0LhSn2/E=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=msOR0Xs0MXq3oe/K35JmoAbAUd/hqExwGp9G8/Y/VL2uViHt5Uyd+B1To4oTK8KaB jwR7VH3BH80xcGijXKlr3AzNUh7Tm4IO9qzOAb4S8x0tfJfKDi1O8nu3xZxUQP0SyP jASXwuAWNUyqcXE+TfK2CHdludfXF+VimZjsb52c= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by sourceware.org (Postfix) with ESMTPS id 17B12385C426 for <libc-alpha@sourceware.org>; Sat, 23 May 2020 20:32:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 17B12385C426 Received: by mail-il1-x144.google.com with SMTP id m6so14137225ilq.7 for <libc-alpha@sourceware.org>; Sat, 23 May 2020 13:32:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cbEiA5rRt3/AFwA55v11QjghUcvGS2AILds0LhSn2/E=; b=WOBz/In9XBEthFTNiZHibZNCiEMVvwoAvgR1ZFbzNhWlY97ahpoxbHoiNOSilrHDK1 mJam54X2PsVXMe/sNq5zozcMWeaeINSVE11ZV8hLBNHw9gkKYLBLCzw/9QLL8l9mOALO HFpRo0uVXSNfsAOpR81X2GkY9AI+gfSgVNiuYupqrbXGNLfsiQpCweySx7wkIszF/aH5 nzeH8rhWWFsoXPvlm5iizZzwFOMW96nxjSvFA42caDVCmyfIYmt6W8e3A0zEE2ygIuD7 z2H0Rz5m9s0rAPFj45983vUDIi6mCgNSlo77E1OOo9MxTJvNDi6WTGZIty8TBhBz3pEe QoXA== X-Gm-Message-State: AOAM531c0kHuBHHyMSjU9pP2H+ZeJVjTu+1j6xcTISwgN3Kk3ibmHg2Z xQKjNjwTII0IFPXWR2T37nqYHU9cd5qim9EpbjY= X-Google-Smtp-Source: ABdhPJxeUDoMtr0Mx+LdpDpez8JQEZebErL1WLElqsq3xaTuO9w++UBYUOpTfoO2pNYN7nPNQ3AezE+mkJsH4Jeta2E= X-Received: by 2002:a92:9f4b:: with SMTP id u72mr19050749ili.273.1590265961502; Sat, 23 May 2020 13:32:41 -0700 (PDT) MIME-Version: 1.0 References: <20200505181605.22346-1-lukma@denx.de> <CAMe9rOq1F4VoaSeh7eQ3S-xTE=8Hx0FacPbPimujn55867kWbQ@mail.gmail.com> <20200521122423.7d98dd96@jawa> <CAMe9rOpJ8Y18r83WgrRt8u3h1TZ=504V9Da2z0DGAUV6ieyOVQ@mail.gmail.com> In-Reply-To: <CAMe9rOpJ8Y18r83WgrRt8u3h1TZ=504V9Da2z0DGAUV6ieyOVQ@mail.gmail.com> Date: Sat, 23 May 2020 13:32:05 -0700 Message-ID: <CAMe9rOppGQG1GV7KZ7g7wr46u8z0O9rBcixOos3vb3o89DHtig@mail.gmail.com> Subject: [PATCH] Fix __clock_gettime64 for sysdeps/generic/hp-timing.h To: Lukasz Majewski <lukma@denx.de> Content-Type: multipart/mixed; boundary="000000000000bc749805a656a5b3" X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <http://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <http://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org> Reply-To: "H.J. Lu" <hjl.tools@gmail.com> Cc: Florian Weimer <fweimer@redhat.com>, GNU C Library <libc-alpha@sourceware.org>, Andreas Schwab <schwab@suse.de>, Alistair Francis <alistair.francis@wdc.com>, Joseph Myers <joseph@codesourcery.com> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
Fix __clock_gettime64 for sysdeps/generic/hp-timing.h
|
|
Commit Message
H.J. Lu
May 23, 2020, 8:32 p.m. UTC
On Thu, May 21, 2020 at 4:11 AM H.J. Lu <hjl.tools@gmail.com> wrote: > > On Thu, May 21, 2020 at 3:24 AM Lukasz Majewski <lukma@denx.de> wrote: > > > > Hi "H.J. Lu", > > > > > On Tue, May 5, 2020 at 11:21 AM Lukasz Majewski <lukma@denx.de> wrote: > > > > > > > > The __clock_gettime internal function is not supporting 64 bit time > > > > on architectures with __WORDSIZE == 32 and __TIMESIZE != 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 == > > > > 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(-) > > > > > > > > > > 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/benchtests/bench-rint.c:45: > > > ./bench-skeleton.c: In function ‘main’: > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of ‘tv’ > > > isn’t known 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:82:8: note: in expansion of macro ‘TIMING_NOW’ > > > 82 | TIMING_NOW (start); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:38:3: error: implicit declaration of > > > function ‘__clock_gettime64’; did you mean ‘clock_gettime’? > > > [-Werror=implicit-function-declaration] > > > 38 | __clock_gettime64 (CLOCK_MONOTONIC, &tv); \ > > > | ^~~~~~~~~~~~~~~~~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:82:8: note: in expansion of macro ‘TIMING_NOW’ > > > 82 | TIMING_NOW (start); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable ‘tv’ > > > [-Werror=unused-variable] > > > 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:82:8: note: in expansion of macro ‘TIMING_NOW’ > > > 82 | TIMING_NOW (start); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of ‘tv’ > > > isn’t known 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:86:8: note: in expansion of macro ‘TIMING_NOW’ > > > 86 | TIMING_NOW (end); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable ‘tv’ > > > [-Werror=unused-variable] > > > 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:86:8: note: in expansion of macro ‘TIMING_NOW’ > > > 86 | TIMING_NOW (end); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of ‘tv’ > > > isn’t known 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:90:8: note: in expansion of macro ‘TIMING_NOW’ > > > 90 | TIMING_NOW (start); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable ‘tv’ > > > [-Werror=unused-variable] > > > 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:90:8: note: in expansion of macro ‘TIMING_NOW’ > > > 90 | TIMING_NOW (start); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of ‘tv’ > > > isn’t known 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:94:8: note: in expansion of macro ‘TIMING_NOW’ > > > 94 | TIMING_NOW (end); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable ‘tv’ > > > [-Werror=unused-variable] > > > 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:94:8: note: in expansion of macro ‘TIMING_NOW’ > > > 94 | TIMING_NOW (end); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of ‘tv’ > > > isn’t known 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:103:3: note: in expansion of macro ‘TIMING_NOW’ > > > 103 | TIMING_NOW (start); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable ‘tv’ > > > [-Werror=unused-variable] > > > 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:103:3: note: in expansion of macro ‘TIMING_NOW’ > > > 103 | TIMING_NOW (start); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of ‘tv’ > > > isn’t known 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:106:3: note: in expansion of macro ‘TIMING_NOW’ > > > 106 | TIMING_NOW (end); > > > | ^~~~~~~~~~ > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable ‘tv’ > > > [-Werror=unused-variable] > > > 37 | struct __timespec64 tv; \ > > > | ^~ > > > ./bench-timing.h:35:25: note: in expansion of macro ‘HP_TIMING_NOW’ > > > 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > | ^~~~~~~~~~~~~ > > > ./bench-skeleton.c:106:3: note: in expansion of macro ‘TIMING_NOW’ > > > 106 | TIMING_NOW (end); > > > | ^~~~~~~~~~ > > > cc1: all warnings being treated as errors > > > > How shall I reproduce this error? > > Apply the enclosed patch and do > > $ make USE_CLOCK_GETTIME=1 bench > > > Was it supposed to be catch with build-many-glibc.py ? > > > > No, "make bench" isn't tested by build-many-glibc.py. > Here is the patch to fix __clock_gettime64 for sysdeps/generic/hp-timing.h. OK for master?
Comments
On Sat, 23 May 2020 13:32:05 -0700 "H.J. Lu" <hjl.tools@gmail.com> wrote: > On Thu, May 21, 2020 at 4:11 AM H.J. Lu <hjl.tools@gmail.com> wrote: > > > > On Thu, May 21, 2020 at 3:24 AM Lukasz Majewski <lukma@denx.de> > > wrote: > > > > > > Hi "H.J. Lu", > > > > > > > On Tue, May 5, 2020 at 11:21 AM Lukasz Majewski <lukma@denx.de> > > > > wrote: > > > > > > > > > > The __clock_gettime internal function is not supporting 64 > > > > > bit time on architectures with __WORDSIZE == 32 and > > > > > __TIMESIZE != 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 == 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(-) > > > > > > > > > > > > > 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/benchtests/bench-rint.c:45: > > > > ./bench-skeleton.c: In function ‘main’: > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:38:3: error: implicit > > > > declaration of function ‘__clock_gettime64’; did you mean > > > > ‘clock_gettime’? [-Werror=implicit-function-declaration] > > > > 38 | __clock_gettime64 (CLOCK_MONOTONIC, &tv); \ > > > > | ^~~~~~~~~~~~~~~~~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > ‘tv’ [-Werror=unused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:86:8: note: in expansion of macro > > > > ‘TIMING_NOW’ 86 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > ‘tv’ [-Werror=unused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:86:8: note: in expansion of macro > > > > ‘TIMING_NOW’ 86 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:90:8: note: in expansion of macro > > > > ‘TIMING_NOW’ 90 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > ‘tv’ [-Werror=unused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:90:8: note: in expansion of macro > > > > ‘TIMING_NOW’ 90 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:94:8: note: in expansion of macro > > > > ‘TIMING_NOW’ 94 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > ‘tv’ [-Werror=unused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:94:8: note: in expansion of macro > > > > ‘TIMING_NOW’ 94 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:103:3: note: in expansion of macro > > > > ‘TIMING_NOW’ 103 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > ‘tv’ [-Werror=unused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:103:3: note: in expansion of macro > > > > ‘TIMING_NOW’ 103 | TIMING_NOW (start); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:106:3: note: in expansion of macro > > > > ‘TIMING_NOW’ 106 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > ‘tv’ [-Werror=unused-variable] > > > > 37 | struct __timespec64 tv; \ > > > > | ^~ > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > | ^~~~~~~~~~~~~ > > > > ./bench-skeleton.c:106:3: note: in expansion of macro > > > > ‘TIMING_NOW’ 106 | TIMING_NOW (end); > > > > | ^~~~~~~~~~ > > > > cc1: all warnings being treated as errors > > > > > > How shall I reproduce this error? > > > > Apply the enclosed patch and do > > > > $ make USE_CLOCK_GETTIME=1 bench > > > > > Was it supposed to be catch with build-many-glibc.py ? > > > > > > > No, "make bench" isn't tested by build-many-glibc.py. > > > > Here is the patch to fix __clock_gettime64 for > sysdeps/generic/hp-timing.h. OK for master? > 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 <struct___timespec64.h> ? 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
On Sun, May 24, 2020 at 2:03 AM Lukasz Majewski <lukma@denx.de> wrote: > > On Sat, 23 May 2020 13:32:05 -0700 > "H.J. Lu" <hjl.tools@gmail.com> wrote: > > > On Thu, May 21, 2020 at 4:11 AM H.J. Lu <hjl.tools@gmail.com> wrote: > > > > > > On Thu, May 21, 2020 at 3:24 AM Lukasz Majewski <lukma@denx.de> > > > wrote: > > > > > > > > Hi "H.J. Lu", > > > > > > > > > On Tue, May 5, 2020 at 11:21 AM Lukasz Majewski <lukma@denx.de> > > > > > wrote: > > > > > > > > > > > > The __clock_gettime internal function is not supporting 64 > > > > > > bit time on architectures with __WORDSIZE == 32 and > > > > > > __TIMESIZE != 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 == 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(-) > > > > > > > > > > > > > > > > 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/benchtests/bench-rint.c:45: > > > > > ./bench-skeleton.c: In function ‘main’: > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:38:3: error: implicit > > > > > declaration of function ‘__clock_gettime64’; did you mean > > > > > ‘clock_gettime’? [-Werror=implicit-function-declaration] > > > > > 38 | __clock_gettime64 (CLOCK_MONOTONIC, &tv); \ > > > > > | ^~~~~~~~~~~~~~~~~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > ‘tv’ [-Werror=unused-variable] > > > > > 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:86:8: note: in expansion of macro > > > > > ‘TIMING_NOW’ 86 | TIMING_NOW (end); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > ‘tv’ [-Werror=unused-variable] > > > > > 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:86:8: note: in expansion of macro > > > > > ‘TIMING_NOW’ 86 | TIMING_NOW (end); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:90:8: note: in expansion of macro > > > > > ‘TIMING_NOW’ 90 | TIMING_NOW (start); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > ‘tv’ [-Werror=unused-variable] > > > > > 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:90:8: note: in expansion of macro > > > > > ‘TIMING_NOW’ 90 | TIMING_NOW (start); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:94:8: note: in expansion of macro > > > > > ‘TIMING_NOW’ 94 | TIMING_NOW (end); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > ‘tv’ [-Werror=unused-variable] > > > > > 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:94:8: note: in expansion of macro > > > > > ‘TIMING_NOW’ 94 | TIMING_NOW (end); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:103:3: note: in expansion of macro > > > > > ‘TIMING_NOW’ 103 | TIMING_NOW (start); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > ‘tv’ [-Werror=unused-variable] > > > > > 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:103:3: note: in expansion of macro > > > > > ‘TIMING_NOW’ 103 | TIMING_NOW (start); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:106:3: note: in expansion of macro > > > > > ‘TIMING_NOW’ 106 | TIMING_NOW (end); > > > > > | ^~~~~~~~~~ > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > ‘tv’ [-Werror=unused-variable] > > > > > 37 | struct __timespec64 tv; \ > > > > > | ^~ > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW (var) > > > > > | ^~~~~~~~~~~~~ > > > > > ./bench-skeleton.c:106:3: note: in expansion of macro > > > > > ‘TIMING_NOW’ 106 | TIMING_NOW (end); > > > > > | ^~~~~~~~~~ > > > > > cc1: all warnings being treated as errors > > > > > > > > How shall I reproduce this error? > > > > > > Apply the enclosed patch and do > > > > > > $ make USE_CLOCK_GETTIME=1 bench > > > > > > > Was it supposed to be catch with build-many-glibc.py ? > > > > > > > > > > No, "make bench" isn't tested by build-many-glibc.py. > > > > > > > Here is the patch to fix __clock_gettime64 for > > sysdeps/generic/hp-timing.h. OK for master? > > > > 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 <struct___timespec64.h> ? > include/time.h is also included by other files which may not include <struct___timespec64.h>.
On Sun, 24 May 2020 04:39:47 -0700 "H.J. Lu" <hjl.tools@gmail.com> wrote: > On Sun, May 24, 2020 at 2:03 AM Lukasz Majewski <lukma@denx.de> wrote: > > > > On Sat, 23 May 2020 13:32:05 -0700 > > "H.J. Lu" <hjl.tools@gmail.com> wrote: > > > > > On Thu, May 21, 2020 at 4:11 AM H.J. Lu <hjl.tools@gmail.com> > > > wrote: > > > > > > > > On Thu, May 21, 2020 at 3:24 AM Lukasz Majewski <lukma@denx.de> > > > > wrote: > > > > > > > > > > Hi "H.J. Lu", > > > > > > > > > > > On Tue, May 5, 2020 at 11:21 AM Lukasz Majewski > > > > > > <lukma@denx.de> wrote: > > > > > > > > > > > > > > The __clock_gettime internal function is not supporting 64 > > > > > > > bit time on architectures with __WORDSIZE == 32 and > > > > > > > __TIMESIZE != 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 == 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(-) > > > > > > > > > > > > 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/benchtests/bench-rint.c:45: > > > > > > ./bench-skeleton.c: In function ‘main’: > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:38:3: error: implicit > > > > > > declaration of function ‘__clock_gettime64’; did you mean > > > > > > ‘clock_gettime’? [-Werror=implicit-function-declaration] > > > > > > 38 | __clock_gettime64 (CLOCK_MONOTONIC, &tv); \ > > > > > > | ^~~~~~~~~~~~~~~~~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:86:8: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 86 | TIMING_NOW (end); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:86:8: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 86 | TIMING_NOW (end); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:90:8: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 90 | TIMING_NOW (start); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:90:8: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 90 | TIMING_NOW (start); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:94:8: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 94 | TIMING_NOW (end); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:94:8: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 94 | TIMING_NOW (end); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:103:3: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 103 | TIMING_NOW (start); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:103:3: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 103 | TIMING_NOW (start); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:106:3: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 106 | TIMING_NOW (end); > > > > > > | ^~~~~~~~~~ > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > 37 | struct __timespec64 tv; \ > > > > > > | ^~ > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > ./bench-skeleton.c:106:3: note: in expansion of macro > > > > > > ‘TIMING_NOW’ 106 | TIMING_NOW (end); > > > > > > | ^~~~~~~~~~ > > > > > > cc1: all warnings being treated as errors > > > > > > > > > > How shall I reproduce this error? > > > > > > > > Apply the enclosed patch and do > > > > > > > > $ make USE_CLOCK_GETTIME=1 bench > > > > > > > > > Was it supposed to be catch with build-many-glibc.py ? > > > > > > > > > > > > > No, "make bench" isn't tested by build-many-glibc.py. > > > > > > > > > > Here is the patch to fix __clock_gettime64 for > > > sysdeps/generic/hp-timing.h. OK for master? > > > > > > > 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 <struct___timespec64.h> ? > > > > include/time.h is also included by other files which may not include > <struct___timespec64.h>. > In which files you observe this situation? The <struct___timespec64.h> was introduced to avoid including time.h when only new, y2038 safe struct __timespec64 is necessary. 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
On Sun, May 24, 2020 at 8:30 AM Lukasz Majewski <lukma@denx.de> wrote: > > On Sun, 24 May 2020 04:39:47 -0700 > "H.J. Lu" <hjl.tools@gmail.com> wrote: > > > On Sun, May 24, 2020 at 2:03 AM Lukasz Majewski <lukma@denx.de> wrote: > > > > > > On Sat, 23 May 2020 13:32:05 -0700 > > > "H.J. Lu" <hjl.tools@gmail.com> wrote: > > > > > > > On Thu, May 21, 2020 at 4:11 AM H.J. Lu <hjl.tools@gmail.com> > > > > wrote: > > > > > > > > > > On Thu, May 21, 2020 at 3:24 AM Lukasz Majewski <lukma@denx.de> > > > > > wrote: > > > > > > > > > > > > Hi "H.J. Lu", > > > > > > > > > > > > > On Tue, May 5, 2020 at 11:21 AM Lukasz Majewski > > > > > > > <lukma@denx.de> wrote: > > > > > > > > > > > > > > > > The __clock_gettime internal function is not supporting 64 > > > > > > > > bit time on architectures with __WORDSIZE == 32 and > > > > > > > > __TIMESIZE != 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 == 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(-) > > > > > > > > > > > > > > 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/benchtests/bench-rint.c:45: > > > > > > > ./bench-skeleton.c: In function ‘main’: > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:38:3: error: implicit > > > > > > > declaration of function ‘__clock_gettime64’; did you mean > > > > > > > ‘clock_gettime’? [-Werror=implicit-function-declaration] > > > > > > > 38 | __clock_gettime64 (CLOCK_MONOTONIC, &tv); \ > > > > > > > | ^~~~~~~~~~~~~~~~~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > > 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:82:8: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 82 | TIMING_NOW (start); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:86:8: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 86 | TIMING_NOW (end); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > > 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:86:8: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 86 | TIMING_NOW (end); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:90:8: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 90 | TIMING_NOW (start); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > > 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:90:8: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 90 | TIMING_NOW (start); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:94:8: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 94 | TIMING_NOW (end); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > > 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:94:8: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 94 | TIMING_NOW (end); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:103:3: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 103 | TIMING_NOW (start); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > > 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:103:3: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 103 | TIMING_NOW (start); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of > > > > > > > ‘tv’ isn’t known 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:106:3: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 106 | TIMING_NOW (end); > > > > > > > | ^~~~~~~~~~ > > > > > > > ../sysdeps/generic/hp-timing.h:37:23: error: unused variable > > > > > > > ‘tv’ [-Werror=unused-variable] > > > > > > > 37 | struct __timespec64 tv; \ > > > > > > > | ^~ > > > > > > > ./bench-timing.h:35:25: note: in expansion of macro > > > > > > > ‘HP_TIMING_NOW’ 35 | #define TIMING_NOW(var) HP_TIMING_NOW > > > > > > > (var) | ^~~~~~~~~~~~~ > > > > > > > ./bench-skeleton.c:106:3: note: in expansion of macro > > > > > > > ‘TIMING_NOW’ 106 | TIMING_NOW (end); > > > > > > > | ^~~~~~~~~~ > > > > > > > cc1: all warnings being treated as errors > > > > > > > > > > > > How shall I reproduce this error? > > > > > > > > > > Apply the enclosed patch and do > > > > > > > > > > $ make USE_CLOCK_GETTIME=1 bench > > > > > > > > > > > Was it supposed to be catch with build-many-glibc.py ? > > > > > > > > > > > > > > > > No, "make bench" isn't tested by build-many-glibc.py. > > > > > > > > > > > > > Here is the patch to fix __clock_gettime64 for > > > > sysdeps/generic/hp-timing.h. OK for master? > > > > > > > > > > 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 <struct___timespec64.h> ? > > > > > > > include/time.h is also included by other files which may not include > > <struct___timespec64.h>. > > > > In which files you observe this situation? > > The <struct___timespec64.h> was introduced to avoid including time.h > when only new, y2038 safe struct __timespec64 is necessary. > Without it, I got cc -m32 getprtent_r.c -c -std=gnu11 -fgnu89-inline -O2 -g -march=i686 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -Wstrict-prototypes -Wold-style-definition -fmath-errno -fPIC -Wa,-mtune=i686 -fexceptions -ftls-model=initial-exec -I../include -I/export/build/gnu/tools-build/glibc-32bit-gitlab/build-i686-linux/inet -I/export/build/gnu/tools-build/glibc-32bit-gitlab/build-i686-linux -I../sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/i386/i686/nptl -I../sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86 -I../sysdeps/x86/nptl -I../sysdeps/i386/nptl -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux -I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu/multiarch -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686/multiarch -I../sysdeps/i386/i686 -I../sysdeps/i386/fpu -I../sysdeps/x86/fpu -I../sysdeps/i386 -I../sysdeps/x86 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/float128 -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I. -D_LIBC_REENTRANT -include /export/build/gnu/tools-build/glibc-32bit-gitlab/build-i686-linux/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h -DPIC -DSHARED -DTOP_NAMESPACE=glibc -o /export/build/gnu/tools-build/glibc-32bit-gitlab/build-i686-linux/inet/getprtent_r.os -MD -MP -MF /export/build/gnu/tools-build/glibc-32bit-gitlab/build-i686-linux/inet/getprtent_r.os.dt -MT /export/build/gnu/tools-build/glibc-32bit-gitlab/build-i686-linux/inet/getprtent_r.os In file included from ../sysdeps/nptl/lowlevellock.h:24, from ../sysdeps/unix/sysv/linux/x86/lowlevellock.h:23, from ../nptl/descr.h:29, from ../sysdeps/i386/nptl/tls.h:120, from ../sysdeps/i386/i686/nptl/tls.h:33, from ../include/link.h:51, from ../include/dlfcn.h:4, from ../nss/nsswitch.h:28, from ../include/nsswitch.h:1, from ../inet/netgroup.h:22, from ../include/netdb.h:203, from getprtent_r.c:18: ../include/time.h:9:58: error: ‘struct __timespec64’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror] 9 | extern int __clock_gettime64 (clockid_t clock_id, struct __timespec64 *tp); | ^~~~~~~~~~~~ cc1: all warnings being treated as errors This may happen for all 32-bit targets.
From 912f3579b3034f3b375a43eed4592f9a81301b6f Mon Sep 17 00:00:00 2001 From: "H.J. Lu" <hjl.tools@gmail.com> Date: Sat, 23 May 2020 10:04:20 -0700 Subject: [PATCH] Fix __clock_gettime64 for sysdeps/generic/hp-timing.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit e9698175b0b60407db1e89bcf29437ab224bca0b Author: Lukasz Majewski <lukma@denx.de> Date: Mon Mar 16 08:31:41 2020 +0100 y2038: Replace __clock_gettime with __clock_gettime64 breaks benchtests with sysdeps/generic/hp-timing.h: 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/benchtests/bench-rint.c:45: ./bench-skeleton.c: In function ‘main’: ../sysdeps/generic/hp-timing.h:37:23: error: storage size of ‘tv’ isn’t known 37 | struct __timespec64 tv; \ | ^~ We should always provide __clock_gettime64 for sysdeps/generic/hp-timing.h. Don't define __clock_gettime in benchtests/bench-timing.h since it is no longer needed. --- benchtests/bench-timing.h | 1 - include/time.h | 12 +++++++++--- sysdeps/generic/hp-timing.h | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/benchtests/bench-timing.h b/benchtests/bench-timing.h index a0d6f82465..d0176fb76e 100644 --- a/benchtests/bench-timing.h +++ b/benchtests/bench-timing.h @@ -18,7 +18,6 @@ #undef attribute_hidden #define attribute_hidden -#define __clock_gettime __clock_gettime64 #include <hp-timing.h> #include <stdint.h> diff --git a/include/time.h b/include/time.h index fe4da9ca10..246683a1c5 100644 --- a/include/time.h +++ b/include/time.h @@ -1,6 +1,15 @@ #ifndef _TIME_H #include <time/time.h> +/* For sysdeps/generic/hp-timing.h. */ +extern __typeof (clock_gettime) __clock_gettime; +#if __TIMESIZE == 64 +# define __clock_gettime64 __clock_gettime +#else +struct __timespec64; +extern int __clock_gettime64 (clockid_t clock_id, struct __timespec64 *tp); +#endif + #ifndef _ISOMAC # include <bits/types/struct_timeval.h> # include <struct___timespec64.h> @@ -23,7 +32,6 @@ libc_hidden_proto (localtime) libc_hidden_proto (strftime) libc_hidden_proto (strptime) -extern __typeof (clock_gettime) __clock_gettime; libc_hidden_proto (__clock_gettime) extern __typeof (clock_settime) __clock_settime; libc_hidden_proto (__clock_settime) @@ -295,14 +303,12 @@ extern double __difftime (time_t time1, time_t time0); #if __TIMESIZE == 64 # define __clock_nanosleep_time64 __clock_nanosleep -# define __clock_gettime64 __clock_gettime # define __timespec_get64 __timespec_get #else extern int __clock_nanosleep_time64 (clockid_t clock_id, int flags, const struct __timespec64 *req, struct __timespec64 *rem); libc_hidden_proto (__clock_nanosleep_time64) -extern int __clock_gettime64 (clockid_t clock_id, struct __timespec64 *tp); libc_hidden_proto (__clock_gettime64) extern int __timespec_get64 (struct __timespec64 *ts, int base); libc_hidden_proto (__timespec_get64) diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing.h index af9d92f7f7..7e22d43151 100644 --- a/sysdeps/generic/hp-timing.h +++ b/sysdeps/generic/hp-timing.h @@ -23,6 +23,7 @@ #include <time.h> #include <stdint.h> #include <hp-timing-common.h> +#include <struct___timespec64.h> /* It should not be used for ld.so. */ #define HP_TIMING_INLINE (0) -- 2.26.2