C++ Logo

SG10

Advanced search

Subject: Re: [SG10] Adding a macro to identify the ABI
From: Saleem Abdulrasool (compnerd_at_[hidden])
Date: 2017-01-09 09:52:34


libc++ would like to support both the itanium and the Microsoft ABIs. This
leaks into the header through type_info. The macro would help correctly
build and configure checks to ensure that the ABI matches.

Having the macro defined would allow the headers to inject code into the
user application to ensure the ABI matches at link time without having the
user specify the ABI they believe the compiler to be using.

On Mon, Jan 9, 2017 at 1:29 AM Jonathan Wakely <cxx_at_[hidden]> wrote:

> On 8 January 2017 at 19:30, Saleem Abdulrasool wrote:
>
> > std::type_info comes from the runtime. Someone needs to implement it for
>
> > our to be provided.
>
>
>
> Agreed so far.
>
>
>
> > Having the compiler identify the ABI means that the runtime has a
> concrete
>
> > manner to determine what ABI is being requested.
>
>
>
> Now I'm lost. What determination does the runtime do? Is there a
>
> runtime that can dynamically switch to providing a different ABI?
>
> Surely that's done by linking to a different runtime, i.e. determined
>
> "outside" the runtime, not by it.
>
>
>
> > On certain platforms it is
>
> > not possible to determine the ABI without having the compiler indicate to
>
> > you which is in use.
>
>
>
> OK, but the compiler should also be choosing the right runtime. And
>
> that should all happen correctly without user interaction.
>
>
>
> > Furthermore, this would allow verification that the user code and the
>
> > runtime agree on the ABI itself.
>
>
>
> How would a macro achieve that?
>
>



SG10 list run by sg10-owner@lists.isocpp.org