[cfe-dev] Does clang now emit [abi:cxx11] unconditionally when used with libstdc++?
Maria Gottschalk via cfe-dev
cfe-dev at lists.llvm.org
Wed Aug 17 08:36:15 PDT 2016
Renato Golin <renato.golin at linaro.org> schrieb am 14:16 Mittwoch, 17.August 2016:
> On 16 August 2016 at 19:41, Maria Gottschalk via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>> If major version < 5: never emit abi tags.
>> If major version >=5: emit abi tags if requested with __attribute ((__abi_tag__ ("..."))).
> I don't think that's appropriate, as that would change the behaviour
> based on the library's version, not its source code.
That's precisely the point: every version of gcc comes with it's own copy of libstdc++. For compile-time linking you are supposed to use exactly this copy and nothing else. Now, if clang wants to use libstdc++ from gcc-4.9.2, it has to behave like gcc-4.9.2. And that means not emitting abi tags, even if they are in the code. Doing what gcc-4.9.2 does is the well tested and the de facto right behaviour when using libstdc++ from 4.9.2, even if you think it's buggy.
And the fact that nobody has ever seen gcc emitting abi tags before gcc5 translates to the simple logic outlined above.
> If you don't want abi tags support, stick to Clang 3.8.
Not a very helpful suggestion, but I got it.
More information about the cfe-dev