xuehan, could you avoid top-posting? otherwise other subscribers will have trouble to get context of the discussion if he/she fail to read the whole thread. On Tue, Dec 26, 2017 at 2:35 PM, Xuehan Xu <xxhdx1985126@xxxxxxxxx> wrote: > Thanks for your reply, kefu:-) > > I checked /opt/rh/devtoolset-7/root/usr/include/c++/7/x86_64-redhat-linux/bits/c++config.h, > and saw the following configuration: > > # define _GLIBCXX_USE_DUAL_ABI 0 yes. this is the crux of the problem, see https://git.centos.org/blob/rpms!devtoolset-7-gcc.git/2e5ef6c7934d4417e095855478736742b35bd0af/SPECS!gcc.spec#L1026 . so, - “--with-default-libstdcxx-abi=gcc4-compatible”, the DTS-7's libstdc++'s default ABI is the old one, and - it does *not* use dual ABI. hence what we have is the gcc4 compatible ABI, and nothing more, on centos 7. > > #if ! _GLIBCXX_USE_DUAL_ABI > // Ignore any pre-defined value of _GLIBCXX_USE_CXX11_ABI > # undef _GLIBCXX_USE_CXX11_ABI > #endif > > #ifndef _GLIBCXX_USE_CXX11_ABI > # define _GLIBCXX_USE_CXX11_ABI 0 > #endif > > It seems that no matter how we config MAKEFILE or CMakeFile, > _GLIBCXX_USE_CXX11_ABI would always be 0 under the circumstance. > So I think https://github.com/ceph/ceph/pull/18755 is still needed. > > Is this right? right. unless we swing our own homebrew gcc-7. > > On 26 December 2017 at 00:38, kefu chai <tchaikov@xxxxxxxxx> wrote: >> On Mon, Dec 25, 2017 at 10:43 PM, kefu chai <tchaikov@xxxxxxxxx> wrote: >>> On Sat, Dec 23, 2017 at 5:46 PM, Xuehan Xu <xxhdx1985126@xxxxxxxxx> wrote: >>>> Hi, everyone. >>>> >>>> I'm using CentOS 7 with devtoolset-7 to build ceph. However, I found >>>> that the list::size() in my ceph executables is still counting the >>>> number of nodes. It's so odd, I googled it, and found that this may >>>> have something to do with _GLIBCXX_USE_CXX11_ABI. But even if I >>>> explicitly set _GLIBCXX_USE_CXX11_ABI to 1 when building ceph, the >>>> problem remains. It seems that _GLIBCXX_USE_CXX11_ABI is set to 0 by >>>> gcc no matter how I build the source code, even with >>>> -D_GLIBCXX_USE_CXX11_ABI=1. >>> >>> Xuehan, thanks for testing! >>> >>> turns out the gcc-7 in devtoolset is compiled with >>> "--with-default-libstdcxx-abi=gcc4-compatible", see the output of "g++ >>> -v", so it is using "_GLIBCXX_USE_CXX11_ABI=0", you can by checking >>> /opt/rh/devtoolset-7/root/usr/include/c++/7/x86_64-redhat-linux/bits/c++config.h >>> . >>> >>> in other words, we still need https://github.com/ceph/ceph/pull/18755. >> >> >> hmm, probably not. >> >> add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1) >> >> and >> >> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fabi-version=0") >> >> might help. I will give it a try tomorrow. per the discussion above. we still need it. list::size() is O(n) in libstdc++ offered by DTS-7. -- Regards Kefu Chai -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html