(How) Can I use the new C++ 11 ABI with devtoolset-7 on Centos/RHEL?

后端 未结 1 1120
粉色の甜心
粉色の甜心 2020-12-09 19:52

My goal is to use gcc 7.2 (and clang 6) on Centos 7 to build executables compatible with Centos 7 targets without devtoolset installed but * using the newer C++ ABI *.

相关标签:
1条回答
  • 2020-12-09 20:47

    This seems like a duplicate of the question you linked to, I don't see any reason to keep both open.

    Can I use the new C++ 11 ABI with devtoolset-7 on Centos/RHEL?

    No. The cxx11 ABI affects a number of things internal to libstdc++.so (specifically, locale facets) which cannot be supported by the devtoolset mixed linkage model. The relevant functions that initialize locales are already present in the system libstdc++.so and can't be replaced by the devtoolset's libstdc++_nonshared.a. Because of that (and to avoid other potential ABI mismatches that we don't want to affect RHEL/CentOS users) we disable the new ABI in devtoolset (as correctly stated in the answer to the other question).

    If you really need the new cxx11 ABI you'll need to build your own GCC 7 that uses normal dynamic linking to its own libstdc++.so (rather than the mixed linkage model used by devtoolset) and then ensure that new libstdc++.so gets used at runtime (see Finding Dynamic or Shared Libraries in the manual).

    0 讨论(0)
提交回复
热议问题