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

Maria Gottschalk via cfe-dev cfe-dev at lists.llvm.org
Mon Aug 15 13:30:19 PDT 2016


I did a little experiment. I've built 3.9.0rc1 with gcc-4.9.2 and then let this 3.9.0rc1 rebuild itself (using again headers and  libstdc++ from gcc-4.9.2).
$ nm -C libLLVMCore.a  | grep cxx110000000000000000 W std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::erase[abi:cxx11](std::_Rb_tree_iterator<std::pair<std::string const, std::string> >)0000000000000000 W std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::erase[abi:cxx11](std::_Rb_tree_const_iterator<std::pair<std::string const, std::string> >)

That's two times  [abi:cxx11]. But libstdc++ from gcc-4.9.2 doesn't use abi tags, does it?
(The build completes anyway and all tests succeed!)
M.

 

    Andrey Bokhanko <andreybokhanko at gmail.com> schrieb am 20:53 Montag, 15.August 2016:
 

 To clarify, this is obviously a compiler flag, but the macro is consumed by the library (not compiler) and doesn't affect how gcc/clang work. Thus, if you want old mangling, just pass this flag either to gcc or clang.
Yours,Andrey

On Monday, August 15, 2016, Andrey Bokhanko <andreybokhanko at gmail.com> wrote:

As I understand, -D_GLIBCXX_USE_CXX11_ABI is a library flag, not compiler one, so clang should work with libstdc++ *exactly* as gcc5+ do. See http://developers.redhat.com/ blog/2015/02/05/gcc5-and-the- c11-abi/ for details.
Yours,Andrey
On Monday, August 15, 2016, Renato Golin <renato.golin at linaro.org> wrote:

On 15 August 2016 at 15:58, Maria Gottschalk via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
> So, is it correct that clang-3.9.0 unconditionally compiles for the new abi? That gcc 4.x.y is no longer usable and that you must have gcc 5+ if you want to use libstdc++?

Oh bother! Adding Dmitry, as he wrote the code [1].

I was under the impression that, if you didn't use the tag, nothing
would have changed.

We don't have many compile-time options like GCC, so this would have
to be a run-time option, if needed.

cheers,
--renato

[1] https://reviews.llvm.org/D1803 5 and https://reviews.llvm.org/D1756 7




  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160815/081f0fe8/attachment.html>


More information about the cfe-dev mailing list