public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>,
	Antonios Salios via Libc-help <libc-help@sourceware.org>,
	Arnd Bergmann <arnd@arndb.de>
Cc: "Antonios Salios" <antonios@mwa.re>,
	"Jan Henrik Weinstock" <jan@mwa.re>,
	"Lukas Jünger" <lukas@mwa.re>, "Rich Felker" <dalias@libc.org>
Subject: Re: 64 bit time_t on riscv32
Date: Mon, 15 Jan 2024 17:15:10 -0300	[thread overview]
Message-ID: <b78b1c76-7213-457b-ad38-7d086ed3149f@linaro.org> (raw)
In-Reply-To: <111c4bfb-bc58-412e-9a37-a5c2ed7f0e3c@linaro.org>



On 15/01/24 16:55, Adhemerval Zanella Netto wrote:
> 
> 
> On 15/01/24 10:40, Florian Weimer via Libc-help wrote:
>> * Antonios Salios via Libc-help:
>>
>>> According to a kernel maintainer, the __USE_TIME_BITS64 macro should be
>>> set on architectures that use 64-bit time [2], otherwise the kernel
>>> headers will not be able to pick the correct definition.
>>
>> __USE_TIME_BITS64 is an internal glibc macro.  It is not used on
>> architectures which have a 64-bit time_t by default.
>>
>> Surely the UAPI headers know which time size the architecture uses in
>> the kernel interface, and can be written arcordingly?
> 
> The use of a glibc internal definition on a kABI header is not really
> a good design.  This seems to be only user so far, so I suggest to fix
> on the kernel to not tie to a glibc internal definition. 
> 
> CCing Rich from musl that most likely would want to see this fixed. The
> Android developers might be interested.

So Arnd raised it was the agreement when it was added 2018 between glibc and 
kernel headers, and we changed the deal three years later. And not sure if 
it was on y2038 draft documentation, or on the initial patchset. Nor I
recall the discussion where it was accorded (Arnd could help me here).  

And I am not sure this is a good design, it ties glibc internal definition
to kABI meaning that glibc won't be able to refactor this code because it
might eventually break the ABI.  I think we will need at least to proper
document this somewhere to avoid future breakages.

For glibc side, I think we can always define the macro so the check would
be '__USE_TIME_BITS64 == 1' for 64 time_t support.  It would require some
internal refactoring, but it should be doable.

  reply	other threads:[~2024-01-15 20:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 12:52 Antonios Salios
2024-01-15 13:40 ` Florian Weimer
2024-01-15 19:55   ` Adhemerval Zanella Netto
2024-01-15 20:15     ` Adhemerval Zanella Netto [this message]
2024-01-15 20:29       ` Arnd Bergmann
2024-01-15 22:26     ` Rich Felker
2024-01-16 11:19       ` Adhemerval Zanella Netto
2024-01-16 15:46         ` Florian Weimer
2024-01-16 15:56           ` Rich Felker
2024-01-16 16:22             ` Florian Weimer
2024-01-16 16:29               ` Adhemerval Zanella Netto
2024-01-16 20:43               ` Rich Felker

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b78b1c76-7213-457b-ad38-7d086ed3149f@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=antonios@mwa.re \
    --cc=arnd@arndb.de \
    --cc=dalias@libc.org \
    --cc=fweimer@redhat.com \
    --cc=jan@mwa.re \
    --cc=libc-help@sourceware.org \
    --cc=lukas@mwa.re \
    /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).