unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
	Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: __xstat et al. as compat symbols
Date: Thu, 22 Oct 2020 09:43:41 -0300	[thread overview]
Message-ID: <a9e9f152-63a2-9842-d1f7-f590b4532aeb@linaro.org> (raw)
In-Reply-To: <877drishd5.fsf@oldenburg2.str.redhat.com>



On 22/10/2020 07:08, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>>> I think the impact of that is a bit narrower because it requires special
>>> compiler flags.  But I suspect I will ask for reverting that in a year
>>> as well. 8-/
>>
>> It is sad that we can't get rid of clunky and not well thought interface,
>> which kind of issues are you seeing that is making you thinking about
>> reverting the libm finite symbols?
> 
> Based on the failures I've seen so far, Ocaml would have to start
> distributing binaries for glibc 2.32 and earlier (probably built on
> something like glibc 2.17) and glibc 2.33 and later (built on glibc
> 2.33).  Other native code compilers are likely affected in the same way.

Indeed it seems that Ocaml distributes static libraries with reference
xstat symbols.  And I agree that this is only one example, I would
expect more libraries would use the xstat symbos.

> 
>>>> The issue is only for static linking, by stopping using
>>>> libc_nonshared.a we need to provide the versioned stat symbols anyway.
>>>> And we still need to handle new ABIs where adding the old xstat
>>>> symbols does not make sense (such as riscv32 or any new 32-bit
>>>> architecture).
>>>
>>> You could use a SHLIB_COMPAT conditional without compat_symbol, the two
>>> are separate.
>>
>> The problem is with:
>>
>>   #if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
>>   int
>>   __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
>>   {
>>   }
>>   #endif
>>
>> It won't be built for static and without using SHLIB_COMPAT in this 
>> case will build the interfaces for ABIs that doe not require it.
> 
> We could rename TEST_COMPAT and use that, I think it already has the
> right semantics.  Or you could use “ifdef have-GLIBC_2.32” at the
> makefile level.

I think TEST_COMPAT would be a better alternative since, it would give all
the information how the symbol should be handled ABI wise on the C file
instead of spreading over multiple files.

> 
>>>> If we just defer the compat move, it would add the needless symbols on
>>>> newer ABIs that we will need to keep supporting indefinitely (even
>>>> though they won't be used anywhere unless user explicily links against
>>>> a protected symbol) and we would eventually need to handle the y2038
>>>> support on old ABIs (with the _TIME_SIZE selection) by either adding
>>>> proper 64-bit time support for by removing the xstat for good.
>>>
>>> See above, we can (and should) remove it on newer ABIs only.
>>
>> So now is we are moving in providing what is supposed to be compat
>> symbols in the static library case as well. Do we really want to start
>> supporting such scenario?
> 
> Downstream, we do not need these symbols for fully static linking, so
> SHLIB_COMPAT would actually be okay for our needs, I think.
> 
> I guess if upstream rejects this, we can provide a stub library that can
> be used to link against the __xstat et al. symbols as a workaround.  But
> if we need it, Debian (with its lack of per-release mass rebuilds) will
> likely need it too, and some other distributions probably as well.  So
> at that point, I think we need to ask ourselves as upstream developers
> whether we are really serving the needs of our users.

I really not sure how is the best way to handle this transitions, since
they tend to require a lot of time and affecting different releases.
And it does not make sense to provide this specific stub libraries as
different project, since it is a implementation detail from glibc itself.

> 
> Maybe this is coming across a bit strongly, I just want to put it out
> there.  If Fedora rawhide breaks after we make a change that is
> technically correct because it affects officially unsupported
> configurations only, it makes sense to pause and think if what we are
> doing is really correct.

Thanks for bring this up, and I agree with you that this breakage might
incur in more headaches than solutions.  I will send a fix to export
the xstat symbols in static objects as well, while preserving the compat
symbols on shared objects.

It is unfortunate that we need to add such workarounds, but it seems 
a better strategy. 

  reply	other threads:[~2020-10-22 12:43 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 19:46 [PATCH 00/16] Add y2038 support for stat functions Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 01/16] linux: Always define STAT_IS_KERNEL_STAT Adhemerval Zanella via Libc-alpha
2020-07-24  8:17   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 02/16] linux: Define STAT64_IS_KERNEL_STAT64 Adhemerval Zanella via Libc-alpha
2020-07-24  8:20   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 03/16] linux: Consolidate xstat{64} Adhemerval Zanella via Libc-alpha
2020-07-23 20:51   ` Joseph Myers
2020-07-24  8:34   ` Lukasz Majewski
2020-09-09 14:46   ` Lukasz Majewski
2020-09-09 18:05     ` Adhemerval Zanella via Libc-alpha
2020-09-10  7:10       ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 04/16] linux: Consolidate lxstat{64} Adhemerval Zanella via Libc-alpha
2020-07-24  8:43   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 05/16] linux: Consolidate fxstat{64} Adhemerval Zanella via Libc-alpha
2020-07-24  9:04   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 06/16] linux: Consolidate fxstatat{64} Adhemerval Zanella via Libc-alpha
2020-07-24  9:14   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 07/16] Linux: Consolidate xmknod Adhemerval Zanella via Libc-alpha
2020-07-24  9:14   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 08/16] Remove internal usage of extensible stat functions Adhemerval Zanella via Libc-alpha
2020-07-24  9:16   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 09/16] Remove stat wrapper functions, move them to exported symbols Adhemerval Zanella via Libc-alpha
2020-07-24  9:23   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 10/16] Remove mknod wrapper functions, move them to symbols Adhemerval Zanella via Libc-alpha
2020-07-23 20:53   ` Joseph Myers
2020-07-23 20:58     ` Adhemerval Zanella via Libc-alpha
2020-07-23 21:01       ` Joseph Myers
2020-07-24  9:25   ` Lukasz Majewski
2020-10-12 22:27   ` Joseph Myers
2020-10-13  0:58     ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 11/16] linux: Move the struct stat{64} to struct_stat.h Adhemerval Zanella via Libc-alpha
2020-07-24  9:27   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 12/16] linux: Implement {l}fstat{at} in terms of fstatat Adhemerval Zanella via Libc-alpha
2020-07-24  9:29   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 13/16] linux: Disentangle fstatat from fxstatat Adhemerval Zanella via Libc-alpha
2020-07-24  9:39   ` Lukasz Majewski
2020-07-24 10:25   ` Florian Weimer via Libc-alpha
2020-07-24 14:39     ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 14/16] linux: Move {f}xstat{at} to compat symbols Adhemerval Zanella via Libc-alpha
2020-07-24  9:40   ` Lukasz Majewski
2020-10-21  5:21   ` __xstat et al. as compat symbols (was: Re: [PATCH 14/16] linux: Move {f}xstat{at} to compat symbols) Florian Weimer via Libc-alpha
2020-10-21 11:59     ` Adhemerval Zanella via Libc-alpha
2020-10-21 12:57       ` __xstat et al. as compat symbols Florian Weimer via Libc-alpha
2020-10-21 13:09         ` Adhemerval Zanella via Libc-alpha
2020-10-22 10:08           ` Florian Weimer via Libc-alpha
2020-10-22 12:43             ` Adhemerval Zanella via Libc-alpha [this message]
2020-10-22 15:37               ` Florian Weimer via Libc-alpha
2020-10-22 16:40                 ` Adhemerval Zanella via Libc-alpha
2020-10-22 18:04                   ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 15/16] linux: Add {f}stat{at} y2038 support Adhemerval Zanella via Libc-alpha
2020-07-23 20:55   ` Joseph Myers
2020-07-23 21:00     ` Adhemerval Zanella via Libc-alpha
2020-07-24 10:53   ` Lukasz Majewski
2020-07-30 12:42     ` Adhemerval Zanella via Libc-alpha
2020-08-02 19:46       ` Maciej W. Rozycki via Libc-alpha
2020-10-06  9:48   ` Lukasz Majewski
2020-10-07 12:52     ` Adhemerval Zanella via Libc-alpha
2020-10-07 14:25       ` Adhemerval Zanella via Libc-alpha
2020-10-07 20:20         ` Lukasz Majewski
2020-10-07 21:01           ` Adhemerval Zanella via Libc-alpha
2020-10-07 21:07         ` Adhemerval Zanella via Libc-alpha
2020-10-08  7:57           ` Lukasz Majewski
2020-10-09 14:05             ` Adhemerval Zanella via Libc-alpha
2020-10-09 15:39               ` Lukasz Majewski
2020-10-09 20:06                 ` Adhemerval Zanella via Libc-alpha
2020-10-13 13:58         ` Lukasz Majewski
2020-10-13 14:18           ` Adhemerval Zanella via Libc-alpha
2020-10-13 14:23             ` H.J. Lu via Libc-alpha
2020-10-13 14:27               ` Adhemerval Zanella via Libc-alpha
2020-10-13 18:14             ` Adhemerval Zanella via Libc-alpha
2020-10-13 21:20               ` Lukasz Majewski
2020-10-13 21:40             ` Lukasz Majewski
2020-10-14 13:15               ` Lukasz Majewski
2020-10-14 13:39                 ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 16/16] linux: Move xmknoda{at} to compat symbols Adhemerval Zanella via Libc-alpha
2020-07-24 10:30   ` Florian Weimer via Libc-alpha
2020-07-24 12:34     ` Adhemerval Zanella via Libc-alpha
2020-07-24 12:43       ` Florian Weimer via Libc-alpha
2020-07-24 12:49         ` Adhemerval Zanella via Libc-alpha
2020-07-24 10:43   ` Lukasz Majewski

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=a9e9f152-63a2-9842-d1f7-f590b4532aeb@linaro.org \
    --to=libc-alpha@sourceware.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=fweimer@redhat.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).