After gcc 5.1 and libstdc++ abi changes, I can not compile any of my applications with clang in c++11 mode. Because of my applications uses c++ libraries, which compiled in c++11 mode, and clang can not handle abi tags. For example if I try to build simple program with boost::program_options clang generate such error: In function `boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::name() const': /usr/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to `boost::program_options::arg' Here is corresponding clang bug https://llvm.org/bugs/show_bug.cgi?id=23529 Reproducible: Always Steps to Reproduce: 1. emerge boost 2. cat > test.cpp #include <iostream> #include <boost/program_options.hpp> int main(int argc, char *argv[]) { namespace po = boost::program_options; po::options_description desc("Allowed options"); std::string file_path; desc.add_options() ("path-to-file", po::value<std::string>(&file_path), "path to some file") ; po::variables_map var_map; po::store( //po::parse_command_line(argc, argv, desc) po::command_line_parser(argc, argv).options(desc).allow_unregistered().run() , var_map); po::notify(var_map); } 3. g++ -Wall -std=c++11 test.cpp -lboost_program_options 4. clang++ -Wall -std=c++11 test.cpp -lboost_program_options -o test2 Actual Results: /tmp/test-acdcf5.o: In function `boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::name() const': test.cpp:(.text._ZNK5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcE4nameEv[_ZNK5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcE4nameEv]+0x49): undefined reference to `boost::program_options::arg' x86_64-pc-linux-gnu-clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation) Expected Results: clang compiler example without errors, as gcc.
This is indeed a problem, but beyond the scope of Gentoo to fix. Until Clang/LLVM addresses this issue, there's nothing we can do.
(In reply to David Seifert from comment #1) > This is indeed a problem, but beyond the scope of Gentoo to fix. Until > Clang/LLVM addresses this issue, there's nothing we can do. On the other hand, you might care to see whether adding -D_GLIBCXX_USE_CXX11_ABI=0 to both your g++ and clang++ CXXFLAGS and LDFLAGS declarations is of any benefit.