From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Lukasz Majewski <lukma@denx.de>
Cc: Joseph Myers <joseph@codesourcery.com>,
Paul Eggert <eggert@cs.ucla.edu>, Andreas Schwab <schwab@suse.de>,
Alistair Francis <alistair23@gmail.com>,
Alistair Francis <alistair.francis@wdc.com>,
GNU C Library <libc-alpha@sourceware.org>,
Siddhesh Poyarekar <siddhesh@gotplt.org>,
Florian Weimer <fweimer@redhat.com>,
Florian Weimer <fw@deneb.enyo.de>,
Zack Weinberg <zackw@panix.com>,
Carlos O'Donell <carlos@redhat.com>
Subject: Re: [PATCH v4 1/2] y2038: linux: Provide __timerfd_gettime64 implementation
Date: Tue, 7 Jan 2020 09:36:45 -0300 [thread overview]
Message-ID: <b09ec981-7cf4-19e8-74b9-74c558ba0e75@linaro.org> (raw)
In-Reply-To: <20200107102752.396f7f6f@jawa>
On 07/01/2020 06:27, Lukasz Majewski wrote:
>> As a side note, now that arch-syscall patch is upstream should we
>> assume that for !__ASSUME_TIME64_SYSCALLS the __NR_timerfd_gettime64
>> should be defined (meaning that Linux supports time64 for all 32-bit
>> architectures)?
>
> Only Linux version >= 5.1 supports 64 bit time on archs with __WORDSIZE
> = 32. I do guess (but I may be wrong here) that the arch-syscall is
> supposed to reflect the exact syscalls provided by kernel headers used
> for building (to help with validation of Y2038 patches).
The arch-syscall is now autogenerated from the latest kernel release
defined in build-many-glibcs.py. So the question is whether Linux
support and enforces time64 support on all and future 32-bit
architectures or if there is still some missing ones (as it has
happen on some syscall additions, where some architecture lag
behind some releases).
>
>>
>>> + struct itimerspec its32;
>>> + int retval = INLINE_SYSCALL_CALL (timerfd_gettime, fd, &its32);
>>> + if (retval == 0)
>>> + {
>>> + value->it_interval = valid_timespec_to_timespec64
>>> (its32.it_interval);
>>> + value->it_value = valid_timespec_to_timespec64
>>> (its32.it_value);
>>> + }
>>> +
>>> + return retval;
>>> +#endif
>>> +}
>>
>>
>> Ok.
>>
>>> +
>>> +#if __TIMESIZE != 64
>>> +libc_hidden_def (__timerfd_gettime64)
>>
>> Ok.
>>
>> As a side note, we should fix it on clock_{get,set}time to add the
>> missing libc_hidden_def.
>
> The clock_gettime already has libc_hidden_def. The difference is that we
> use some compatibility code (after moving clock_gettime from librt to
> libc) instead of strong_alias (as it mimics the behavior from auto
> generated syscall wrapper).
I meant for the new time64 symbols. Currently it is not an issue because
the internal time64 symbol is not exported and static linker uses the
internal __GI_ name for the symbol. For instance, objdump -t on
clock_gettime.os on a 32-bit architecture (powerpc in this case) shows:
00000144 g F .text 00000088 __clock_gettime
00000144 g F .text 00000088 __clock_gettime_2
00000000 g F .text 00000144 .hidden __GI___clock_gettime64
00000144 g F .text 00000088 .hidden __GI___clock_gettime
00000144 g F .text 00000088 clock_gettime@@GLIBC_2.17
00000144 g F .text 00000088 clock_gettime@GLIBC_2.2
Where with a libc_hidden_def (__clock_gettime64) it shows:
00000144 g F .text 00000088 __clock_gettime
00000144 g F .text 00000088 __clock_gettime_2
00000000 g F .text 00000144 .hidden __GI___clock_gettime64
*00000000 g F .text 00000144 __clock_gettime64
00000144 g F .text 00000088 .hidden __GI___clock_gettime
00000144 g F .text 00000088 clock_gettime@@GLIBC_2.17
00000144 g F .text 00000088 clock_gettime@GLIBC_2.2
The requirement of libc_hidden_def will de defined in the end if glibc
exports or not __clock_gettime64 on some header redirection or if
clock_gettime64 would be suffice (with a {weak,strong}_alias).
However I do think we should fix it to avoid such confusion why there
is a hidden_proto and not a hidden_def.
next prev parent reply other threads:[~2020-01-07 12:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-06 12:17 [PATCH v4 1/2] y2038: linux: Provide __timerfd_gettime64 implementation Lukasz Majewski
2020-01-06 12:17 ` [PATCH v4 2/2] y2038: linux: Provide __timerfd_settime64 implementation Lukasz Majewski
2020-01-06 21:06 ` Adhemerval Zanella
2020-01-06 20:34 ` [PATCH v4 1/2] y2038: linux: Provide __timerfd_gettime64 implementation Adhemerval Zanella
2020-01-07 9:27 ` Lukasz Majewski
2020-01-07 12:36 ` Adhemerval Zanella [this message]
2020-01-07 14:25 ` Lukasz Majewski
2020-01-07 15:26 ` Arnd Bergmann
2020-01-07 20:16 ` Adhemerval Zanella
2020-01-07 20:22 ` Arnd Bergmann
2020-01-07 23:06 ` Lukasz Majewski
2020-01-07 12:49 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b09ec981-7cf4-19e8-74b9-74c558ba0e75@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=alistair23@gmail.com \
--cc=carlos@redhat.com \
--cc=eggert@cs.ucla.edu \
--cc=fw@deneb.enyo.de \
--cc=fweimer@redhat.com \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
--cc=lukma@denx.de \
--cc=schwab@suse.de \
--cc=siddhesh@gotplt.org \
--cc=zackw@panix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).