[cfe-dev] Does clang now emit [abi:cxx11] unconditionally when used with libstdc++?

Maria Gottschalk via cfe-dev cfe-dev at lists.llvm.org
Tue Aug 16 11:41:38 PDT 2016


My two cents: clang already knows the exact version of gcc from which it borrows libstdc++, because it sorts available gcc's by version number to pick the one with the highest number. Then:


If major version < 5: never emit abi tags.

If major version >=5: emit abi tags if requested with __attribute ((__abi_tag__ ("..."))).


This on the assumption that there is something to fix. Richard said there isn't. I wouldn't know.

M.



Dmitry Polukhin via cfe-dev <cfe-dev at lists.llvm.org> schrieb am 20:00 Dienstag, 16.August 2016:



I agree that it looks like a GCC bug that abi_tags are ignored in GCC 4.9.2. Anyway, if at some point we will want to implement it in Clang, I think right approach is to implement -fabi_version flags and, if specified ABI version is below GCC5, don't emit abi_tags in mangling.


On Tue, Aug 16, 2016 at 1:05 AM, Richard Smith via cfe-dev <cfe-dev at lists.llvm.org> wrote:

On Mon, Aug 15, 2016 at 2:53 PM, Renato Golin via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>
>On 15 August 2016 at 22:43, Maria Gottschalk <gottschalk_maria at yahoo.de> wrote:
>>> But actually, there were abi tags already in 4.9.2, e.g.
>>>
>>> But then gcc-4.9.2 doesn't emit any, while now clang-3.9.0 does!
>>
>>I'd risk say this is a bug in GCC. Or at least a pretty ugly
>>implementation of something that should be simple.
>>
>
>
>If it's only applied to an inline function, and that function did in fact take an ABI break in libstdc++ 4.9.2, then this seems unproblematic. If anything, our results will be marginally better than GCC 4.9.2's, because we'll do the right thing when mixing libstdc++ 4.9.2 and an earlier version. It looks like there is nothing to fix here.
> 
>We can't be compatible with all versions of GCC on what attributes
>>they support and the compile-time flags that they use. This just
>>doesn't scale.
>>
>>In a way, if you don't want ABI tags, use Clang 3.8 or before. If you
>>do, use Clang 3.9 or after.
>>
>>I'm not sure there's a better way of doing this and creating a
>>compile-time flag just to imitate GCC seems like the wrong way to go,
>>IMO.
>>
>>cheers,
>>--renato
>>
>>______________________________ _________________
>>cfe-dev mailing list
>>cfe-dev at lists.llvm.org
>>http://lists.llvm.org/cgi-bin/ mailman/listinfo/cfe-dev
>>
>
>______________________________ _________________
>cfe-dev mailing list
>cfe-dev at lists.llvm.org
>http://lists.llvm.org/cgi-bin/ mailman/listinfo/cfe-dev
>
>


_______________________________________________
cfe-dev mailing list
cfe-dev at lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


More information about the cfe-dev mailing list