On Wed, 13 Oct 2021, Martin Uecker wrote:

> There is currently no standard way to set or query
> the static chain from C although this is used by
> many other languages. Also function pointers in C
> usually can not store the static chain. I am going
> to propose to WG14 to add some kind of wide function
> pointer to address this.  I am doing back ground
> research to understand whether this exists everywhere.

This doesn't answer your actual question, but:

Following discussions of atomics at the last WG14 meeting, I raised the 
question on the WG14 reflector (and C++ liaison list) of whether it would 
be useful to have a public list of C-relevant ABIs and their maintainer 
contacts and ABI-relevant new features in C language versions.  I was 
thinking of such a list as being to help people do due diligence after 
making ABI-relevant C standard changes (contacting the main ABI 
maintainers to get them to add ABI specification for the new features) and 
to help ABI maintainers track new features for which they need to update 
their ABIs.  But such a list could equally be relevant for such research 
as you mention above in advance of proposing a new feature.

There weren't any replies to my message from anyone actually saying they'd 
find such a list useful.  If you think such a list would be useful (for 
the community of people dealing with maintaining ABIs or ABI 
implementations or specifying new language features needing corresponding 
ABIs), then I'd encourage replying to my reflector message of 2 September 
to say so.

Message of 2 September below, for reference of readers not on the WG14 
reflector or C++ liaison list:

======================================================================

To expand on something I mentioned in the atomics discussion in today's 
WG14 meeting:

When new ABI-relevant features have been added to C, the community of 
people involved in C implementations hasn't always done well at updating 
relevant ABIs to achieve consistency between implementations for those new 
features (where those implementations aim to allow mixing code built with 
different implementations for the same architecture/OS - this isn't 
relevant for all C implementations).  Atomics are just one example where 
the ABI issues are more complicated than usual, and where actual 
incompatibilities have arisen between implementations as well as between C 
and C++.

Should there be some maintained public list of C-relevant ABI documents 
(mainly, not entirely, psABI documents for various architectures), and of 
where they are maintained (if they are) / who the maintainer contacts are?  
What about lists of ABI-relevant new features in different C versions that 
ABIs may need to be updated for (and, for that matter, common extensions 
it may be helpful to consider in ABIs), or some mailing list or other 
location to help psABI maintainers (and other relevant ABI maintainers - 
for example, new features often need to be handled by debug info formats 
such as DWARF as well) track new features they need to pay attention to?  
Or guidance on issues to consider when writing a psABI document?  Do such 
lists already exist somewhere?

As an example of the sort of thing I might hope to find in such a list of 
ABI documents / contacts:

* x86-64:

PDFs https://gitlab.com/x86-psABIs/x86-64-ABI/-/wikis/x86-64-psABI
repository https://gitlab.com/x86-psABIs/x86-64-ABI
mailing list https://groups.google.com/g/x86-64-abi

* i386:

PDFs https://gitlab.com/x86-psABIs/i386-ABI/-/wikis/Intel386-psABI
repository https://gitlab.com/x86-psABIs/i386-ABI/-/tree/hjl/x86/master
mailing list https://groups.google.com/g/ia32-abi

* Arm and AArch64:

PDFs https://github.com/ARM-software/abi-aa/releases
repository https://github.com/ARM-software/abi-aa

* RISC-V:

PDFs https://github.com/riscv/riscv-elf-psabi-doc/releases
repository https://github.com/riscv/riscv-elf-psabi-doc

(but hopefully covering more architectures than that).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to