V10 [PATCH] sysconf: Add _SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305]
Carlos O'Donell
carlos@redhat.com
Mon Jan 25 14:34:44 GMT 2021
On 1/25/21 8:58 AM, Carlos O'Donell wrote:
> On 1/22/21 2:41 PM, H.J. Lu wrote:
>> On Wed, Jan 20, 2021 at 7:05 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>>>
>>> On Wed, Jan 20, 2021 at 6:16 AM Carlos O'Donell <carlos@redhat.com> wrote:
>>>>
>>>> On 11/20/20 6:13 PM, H.J. Lu via Libc-alpha wrote:
>>>>> On Fri, Nov 20, 2020 at 6:12 AM Florian Weimer <fw@deneb.enyo.de> wrote:
>>>>>>
>>>>>> * H. J. Lu:
>>>>>>
>>>>>>> Can we reach a consensus for _GNU_SOURCE vs _SC_SIGSTKSZ_SOURCE?
>>>>>>>
>>>>>>> How about we make _GNU_SOURCE to enable _SC_SIGSTKSZ_SOURCE and
>>>>>>> check _SC_SIGSTKSZ_SOURCE != 0? If _GNU_SOURCE triggers compilation
>>>>>>> error and source codes can't be changed, we can add
>>>>>>> -D_SC_SIGSTKSZ_SOURCE=0 to disable _SC_SIGSTKSZ_SOURCE.
>>>>>>
>>>>>> I think the source code compatibility is much more obscure than the
>>>>>> other things we broke quite recently, even without deprecation. Why
>>>>>> do we add the complexity in this case? I feel it is disproportional.
>>>>>
>>>>> Here is the patch with _GNU_SOURCE. Any comments?
>>>>
>>>> (1) New version of patch.
>>>>
>>>> This patch no longer compiles due to __cpuid_count errors.
>>>>
>>>> Could you please update this and post a v9?
>>>
>>> Fixed.
>>>
>>>> This is ABI addition for the constants so I want to make sure I review
>>>> something that works and is final from your end.
>>>>
>>>> (2) Kernel definition of constant for AT_MINSIGSTKSZ?
>>>>
>>>> We don't have a released kernel for x86 with this constant defined?
>>>>
>>>> The kernel patch was only just updated 5 days ago:
>>>> https://sourceware.org/pipermail/libc-alpha/2021-January/121671.html
>>>>
>>>> Doesn't this mean this patch is inappropriate for glibc 2.33?
>>>
>>> The new glibc works with the older kernels. In many cases, we
>>> use emulation for the older kernels. This patch only uses the
>>> existing kernel interface. The kernel patch you referred doesn't
>>> add any new interface. It simply uses the existing AT_MINSIGSTKSZ
>>> for x86. My patch includes an emulation for the older kernels. I
>>> think my patch is appropriate for glibc 2.33.
>>>
>>> Here is the updated patc.
>>>
>>> Thanks.
>>
>> Another rebase.
>
> This change looks good to me.
>
> We add two new constants _SC_MINSIGSTKSZ and _SC_SIGSTKSZ.
>
> We document them as constants to sysconf().
>
> We document _SC_SIGSTKSZ_SOURCE as the way to request this change.
>
> We document this is part of _GNU_SOURCE.
>
> This may break application builds and may need to be worked around if
> the application expected static allocation and need to switch to dynamic
> allocation of a constant at runtime. This kind of change may not always
> be easy to architect, but should be possible with an early constructor.
>
> Tested on i686 and x86_64 and all pass.
>
> Tested-by: Carlos O'Donell <carlos@redhat.com>
> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This was discussed on the weekly patch review meeting.
HJ and I agreed we would delay this until 2.34 opens.
Likewise the deprecation.
I will add a NEWS item that we are going to do this deprecation.
--
Cheers,
Carlos.
More information about the Libc-alpha
mailing list