public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: "Andreas K. Huettel" <dilfridge@gentoo.org>,
	libc-alpha@sourceware.org, floppym@gentoo.org
Subject: Re: CONFIG_COMPAT_32BIT_TIME in the kernel, x86 ABI on x86-64
Date: Sun, 23 Jul 2023 15:46:20 -0300	[thread overview]
Message-ID: <1e8a84bf-4b7f-67bc-ba8d-6a434afb2b8c@linaro.org> (raw)
In-Reply-To: <8005565.6fTUFtlzNn@pinacolada>



On 23/07/23 12:16, Andreas K. Huettel wrote:
> Dear all, 
> 
> one of my Gentoo colleagues (Mike Gilbert, floppym) found this, so I'm forwarding
> his notes:
> 
> ===
> Using utimensat as an example, the kernel interface is as follows:
> 
> When CONFIG_COMPAT_32BIT_TIME is enabled, the kernel provides both the legact 
> 32-bit interface (utimensat) and the 64-bit interface (utimensat_time64).
> When CONFIG_COMPAT_32BIT_TIME is disabled, only the 64-bit interface 
> (utimensat_time64) is provided. utimensat gives ENOSYS.
> 
> Behavior of utimensat64 libc function before b286eca5d4117b3e17c939e3df56e132ae623df1:
> 
> 1. Try utimensat_time64
> 2. If ENOSYS, fall back to utimensat if the arguments are small enough to fit in 32-bits
> 
> Behavior of utimensat64 libc function after b286eca5d4117b3e17c939e3df56e132ae623df1:
> 
> 1. If the arguments are small enough to fit in 32-bits, use utimensat
> 2. If the arguments are too large, use utimensat_time64
> 
> The new behavior fails when CONFIG_COMPAT_32BIT_TIME is disabled, since utimensat is 
> unavailable.
> 
> Several other glibc functions were updated with similar behavior changes.
> ===
> 
> What's to do?

It has been already discussed [1], and not only glibc but musl creator Rich
agreed [2] that this option is a gratuitous userspace API/ABI stability policy 
breakage that Linux (at least Linus and some other maintainers) is adamant to 
not introduce.

At least for glibc we have the option to configure with a minimum 5.1 kernel
(--enable-kernel=5.1) which should disable the 32 bit syscall fallback.  This
should work with CONFIG_COMPAT_32BIT_TIME, although I have not actually
test it.

[1] https://sourceware.org/pipermail/libc-alpha/2022-November/143330.html
[2] https://sourceware.org/pipermail/libc-alpha/2022-November/143349.html

  parent reply	other threads:[~2023-07-23 18:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-23 15:16 Andreas K. Huettel
2023-07-23 15:21 ` Andreas K. Huettel
2023-07-23 18:46 ` Adhemerval Zanella Netto [this message]
2023-07-24 12:55   ` Carlos O'Donell
2023-07-24 13:16     ` Andreas Schwab
2023-07-24 13:22     ` Adhemerval Zanella Netto

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=1e8a84bf-4b7f-67bc-ba8d-6a434afb2b8c@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=dilfridge@gentoo.org \
    --cc=floppym@gentoo.org \
    --cc=libc-alpha@sourceware.org \
    /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).