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=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 2EA4E1F55B for ; Thu, 28 May 2020 14:29:07 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2EF0E3895473; Thu, 28 May 2020 14:29:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EF0E3895473 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1590676146; bh=7grgW7Ybn7JbUErF4h3B4nt8IBfftU/taNmJndebs9Y=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=OKQa4ASVZzeuSUBZx7df0MSZ0mUaowyN/4UZJ4ZjpzCBNRhYZEb+YvCc6+AI710XH cJGi3EdDTAdQTyfurJ2AWKmxws40u70eBfLcR7G8b7tzq2NOSQyliGiowPpLyxVqHL 8SHwM1XVgUy9QKl+3bzvM9e0TMTBzc7kVXseYnmo= Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id 265DB386EC79 for ; Thu, 28 May 2020 14:29:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 265DB386EC79 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-146-k5qzNY-mNMqE1EYzqbOfNw-1; Thu, 28 May 2020 10:28:59 -0400 X-MC-Unique: k5qzNY-mNMqE1EYzqbOfNw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3C103800D24; Thu, 28 May 2020 14:28:58 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-112-91.ams2.redhat.com [10.36.112.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 045345D9EF; Thu, 28 May 2020 14:28:56 +0000 (UTC) To: "H.J. Lu" Subject: Re: [PATCH] Fix __clock_gettime64 with _ISOMAC in sysdeps/generic/hp-timing.h References: <20200505181605.22346-1-lukma@denx.de> <87v9kkmgcw.fsf@igel.home> <87367lk0nk.fsf@oldenburg2.str.redhat.com> <87y2pdiltl.fsf@oldenburg2.str.redhat.com> <87sgfkb4ij.fsf@oldenburg2.str.redhat.com> Date: Thu, 28 May 2020 16:28:55 +0200 In-Reply-To: (H. J. Lu's message of "Thu, 28 May 2020 06:07:20 -0700") Message-ID: <87sgfk9lqw.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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: , From: Florian Weimer via Libc-alpha Reply-To: Florian Weimer Cc: Andreas Schwab , Alistair Francis , "H.J. Lu via Libc-alpha" , Joseph Myers Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" * H. J. Lu: > On Thu, May 28, 2020 at 5:58 AM Florian Weimer wrote: >> >> * H. J. Lu via Libc-alpha: >> >> > diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing.h >> > index af9d92f7f7..99b12995f1 100644 >> > --- a/sysdeps/generic/hp-timing.h >> > +++ b/sysdeps/generic/hp-timing.h >> > @@ -24,6 +24,11 @@ >> > #include >> > #include >> > >> > +#ifdef _ISOMAC >> > +# define __timespec64 timespec >> > +# define __clock_gettime64 clock_gettime >> > +#endif >> > + >> > /* It should not be used for ld.so. */ >> > #define HP_TIMING_INLINE (0) >> >> To be honest, I would have expected different definitions of the timing >> macros. This redirection looks a bit iffy for me for _ISOMAC. > > What do you have in mind? Something like this: /* The clock_gettime (CLOCK_MONOTONIC) has unspecified starting time, nano-second accuracy, and for some architectues is implemented as vDSO symbol. */ #ifdef _ISOMAC # define HP_TIMING_NOW(var) \ ({ \ struct timespec tv; \ clock_gettime (CLOCK_MONOTONIC, &tv); \ (var) = (tv.tv_nsec + UINT64_C(1000000000) * tv.tv_sec); \ }) #else # define HP_TIMING_NOW(var) \ ({ \ struct __timespec64 tv; \ __clock_gettime64 (CLOCK_MONOTONIC, &tv); \ (var) = (tv.tv_nsec + UINT64_C(1000000000) * tv.tv_sec); \ }) #endif in sysdeps/generic/hp-timing.h. Thanks, Florian