Re: switching ARC to 64-bit time_t (Re: [RFC v6 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64)
- To: Lukasz Majewski <lukma@denx.de>
- Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>, Alistair Francis <alistair23@gmail.com>, Joseph Myers <joseph@codesourcery.com>, Florian Weimer <fweimer@redhat.com>, GNU C Library <libc-alpha@sourceware.org>, Palmer Dabbelt <palmerdabbelt@google.com>, Zong Li <zongbox@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, Adhemerval Zanella <adhemerval.zanella@linaro.org>, "Maciej W. Rozycki" <macro@wdc.com>, arcml <linux-snps-arc@lists.infradead.org>, debian-arm@lists.debian.org, Helmut Grohne <helmutg@debian.org>, Viresh Kumar <vireshk@kernel.org>
- Subject: Re: switching ARC to 64-bit time_t (Re: [RFC v6 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64)
- From: Arnd Bergmann <arnd@arndb.de>
- Date: Thu, 20 Feb 2020 17:08:06 +0100
- Message-id: <[🔎] CAK8P3a2vvuqzLQqrYkyyYBFATDjCpBuR2Zquu-xB2BWmc5GQWA@mail.gmail.com>
- In-reply-to: <[🔎] 20200220164245.035e09b1@jawa>
- References: <cover.1578824547.git.alistair.francis@wdc.com> <4e95f95966d8d7c6a8339160dc62d81c1f6a1bfb.1578824547.git.alistair.francis@wdc.com> <00574bfb-981a-3a1c-cbdf-b2fee4eddc32@gmail.com> <CAKmqyKMyf2psPp+-EHoidvbPbSXv0=dP26GjVQnT5BUriLc1gA@mail.gmail.com> <alpine.DEB.2.21.2002120123230.3988@digraph.polyomino.org.uk> <CAKmqyKOgFRfMOws_-48GqMnuS3ygmN9A4DzLg6UtEjRXVoM82A@mail.gmail.com> <8a9784b3-fc52-adc3-4595-33142b059388@synopsys.com> <20200220001136.2f14236e@jawa> <[🔎] CAK8P3a1b73K+RjfHONWLy_dFUucXxwd+0jTnHmkf6YqwRjit4w@mail.gmail.com> <[🔎] 20200220103716.2f526933@jawa> <[🔎] CAK8P3a1nte0nGMw8_aeS__iJsTvsSGYYuKivAYBdiGH-GjVGew@mail.gmail.com> <[🔎] 20200220141451.3fa2fc3f@jawa> <[🔎] CAK8P3a2qLZBAuP-YT2=KZoP+V23TAKvw5W1_2t7rEr2RobLsWw@mail.gmail.com> <[🔎] 20200220164245.035e09b1@jawa>
On Thu, Feb 20, 2020 at 4:42 PM Lukasz Majewski <lukma@denx.de> wrote:
> > On Thu, Feb 20, 2020 at 2:15 PM Lukasz Majewski <lukma@denx.de> wrote:
>
> I do see two approaches here:
>
> 1. In glibc:
>
> When -D_TIME_BITS=64 is set - redirections are enabled for syscall
> wrappers; for example __clock_settime64 is used instead of
> __clock_settime (e.g. sysdeps/unix/sysv/linux/clock_settime).
>
> The latter is guarded by #ifdef __TIMESIZE != 64 so we could change
> mechanically that __clock_settime returns -1 and sets errno to -ENOTSUPP
What I meant is to remove the __clock_settime function from the
library entirely to cause a link failure. I suppose replacing most
"__TIMESIZE != 64" with '0' would do that. Ideally I'd just set
__TIMESIZE to 64, but doing that would make the ABI incompatible
with mainline glibc.
> 2. In kernel - return -ENOTSUPP when clock_settime syscall instead of
> clock_settime64 is invoked.
We already have that with CONFIG_COMPAT_32BIT_TIME, but
at the moment I think that still breaks glibc's usage of __NR_futex,
and a compile-time error is always better than a runtime error,
as it's easier to catch them reliably
Arnd
Reply to: