can not compile itself using clang++-4.0 + libcxx. I confirmed this issue on both Linux and FreeBSD. Steps to Reproduce: 1. USE="-doc libcxx" emerge sys-devel/clang sys-devel/clang-runtime sys-libs/compiler-rt-sanitizers sys-libs/libcxx sys-libs/compiler-rt sys-libs/libomp sys-devel/llvm (build with gcc) 2. CC=clang CXX="clang++ -stdlib=libc++" USE="-doc libcxx" emerge sys-devel/clang [26/811] : && /usr/bin/clang++ -stdlib=libc++ -m32 -O2 -pipe -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -fcolor-diagnostics -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -pedantic -Wno-long-long -Wno-nested-anon-types -Wl,-O1 -Wl,--as-needed -Wl,-rpath-link,/var/tmp/portage/sys-devel/clang-4.0.0_rc1/work/cfe-4.0.0rc1.src-abi_x86_32.x86/./lib32 -Wl,-O3 -Wl,--gc-sections utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangASTNodesEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangAttrEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangCommentCommandInfoEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangCommentHTMLTagsEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangDiagnosticsEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangSACheckersEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/NeonEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/TableGen.cpp.o -o bin/clang-tblgen -Wl,-rpath,"\$ORIGIN/../lib32" /usr/lib32/libLLVMSupport.so.4.0.0 /usr/lib32/libLLVMTableGen.so.4.0.0 && : FAILED: : && /usr/bin/clang++ -stdlib=libc++ -m32 -O2 -pipe -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -fcolor-diagnostics -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -pedantic -Wno-long-long -Wno-nested-anon-types -Wl,-O1 -Wl,--as-needed -Wl,-rpath-link,/var/tmp/portage/sys-devel/clang-4.0.0_rc1/work/cfe-4.0.0rc1.src-abi_x86_32.x86/./lib32 -Wl,-O3 -Wl,--gc-sections utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangASTNodesEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangAttrEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangCommentCommandInfoEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangCommentHTMLTagsEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangDiagnosticsEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangSACheckersEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/NeonEmitter.cpp.o utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/TableGen.cpp.o -o bin/clang-tblgen -Wl,-rpath,"\$ORIGIN/../lib32" /usr/lib32/libLLVMSupport.so.4.0.0 /usr/lib32/libLLVMTableGen.so.4.0.0 && : utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/TableGen.cpp.o: In function `llvm::cl::opt<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false, llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::opt<char [16], llvm::cl::desc, llvm::cl::value_desc, llvm::cl::OptionHidden>(char const (&) [16], llvm::cl::desc const&, llvm::cl::value_desc const&, llvm::cl::OptionHidden const&)': /var/tmp/portage/sys-devel/clang-4.0.0_rc1/work/cfe-4.0.0rc1.src/utils/TableGen/TableGen.cpp:(.text._ZN4llvm2cl3optINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEELb0ENS0_6parserIS8_EEEC2IJA16_cNS0_4descENS0_10value_descENS0_12OptionHiddenEEEEDpRKT_[_ZN4llvm2cl3optINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEELb0ENS0_6parserIS8_EEEC2IJA16_cNS0_4descENS0_10value_descENS0_12OptionHiddenEEEEDpRKT_]+0x77): undefined reference to `vtable for llvm::cl::OptionValue<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >' /var/tmp/portage/sys-devel/clang-4.0.0_rc1/work/cfe-4.0.0rc1.src/utils/TableGen/TableGen.cpp:(.text._ZN4llvm2cl3optINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEELb0ENS0_6parserIS8_EEEC2IJA16_cNS0_4descENS0_10value_descENS0_12OptionHiddenEEEEDpRKT_[_ZN4llvm2cl3optINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEELb0ENS0_6parserIS8_EEEC2IJA16_cNS0_4descENS0_10value_descENS0_12OptionHiddenEEEEDpRKT_]+0xcd): undefined reference to `vtable for llvm::cl::opt<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false, llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >' /var/tmp/portage/sys-devel/clang-4.0.0_rc1/work/cfe-4.0.0rc1.src/utils/TableGen/TableGen.cpp:(.text._ZN4llvm2cl3optINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEELb0ENS0_6parserIS8_EEEC2IJA16_cNS0_4descENS0_10value_descENS0_12OptionHiddenEEEEDpRKT_[_ZN4llvm2cl3optINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEELb0ENS0_6parserIS8_EEEC2IJA16_cNS0_4descENS0_10value_descENS0_12OptionHiddenEEEEDpRKT_]+0xd8): undefined reference to `vtable for llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >' utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/NeonEmitter.cpp.o: In function `(anonymous namespace)::Intrinsic::DagEmitter::emitDag(llvm::DagInit*)': /var/tmp/portage/sys-devel/clang-4.0.0_rc1/work/cfe-4.0.0rc1.src/utils/TableGen/NeonEmitter.cpp:(.text._ZN12_GLOBAL__N_19Intrinsic10DagEmitter7emitDagEPN4llvm7DagInitE+0x2d32): undefined reference to `llvm::SetTheory::addOperator(llvm::StringRef, std::__1::unique_ptr<llvm::SetTheory::Operator, std::__1::default_delete<llvm::SetTheory::Operator> >)' /var/tmp/portage/sys-devel/clang-4.0.0_rc1/work/cfe-4.0.0rc1.src/utils/TableGen/NeonEmitter.cpp:(.text._ZN12_GLOBAL__N_19Intrinsic10DagEmitter7emitDagEPN4llvm7DagInitE+0x2da9): undefined reference to `llvm::SetTheory::addOperator(llvm::StringRef, std::__1::unique_ptr<llvm::SetTheory::Operator, std::__1::default_delete<llvm::SetTheory::Operator> >)' /var/tmp/portage/sys-devel/clang-4.0.0_rc1/work/cfe-4.0.0rc1.src/utils/TableGen/NeonEmitter.cpp:(.text._ZN12_GLOBAL__N_19Intrinsic10DagEmitter7emitDagEPN4llvm7DagInitE+0x2e2a): undefined reference to `llvm::SetTheory::addOperator(llvm::StringRef, std::__1::unique_ptr<llvm::SetTheory::Operator, std::__1::default_delete<llvm::SetTheory::Operator> >)' /var/tmp/portage/sys-devel/clang-4.0.0_rc1/work/cfe-4.0.0rc1.src/utils/TableGen/NeonEmitter.cpp:(.text._ZN12_GLOBAL__N_19Intrinsic10DagEmitter7emitDagEPN4llvm7DagInitE+0x2eba): undefined reference to `llvm::SetTheory::addExpander(llvm::StringRef, std::__1::unique_ptr<llvm::SetTheory::Expander, std::__1::default_delete<llvm::SetTheory::Expander> >)' clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. * ERROR: sys-devel/clang-4.0.0_rc1::gentoo failed (compile phase): * (no error message) * * Call stack: * ebuild.sh, line 115: Called src_compile * environment, line 4934: Called multilib-minimal_src_compile * environment, line 3131: Called multilib_foreach_abi 'multilib-minimal_abi_src_compile' * environment, line 3362: Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile' * environment, line 2997: Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile' * environment, line 2995: Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_compile' * environment, line 586: Called multilib-minimal_abi_src_compile * environment, line 3125: Called multilib_src_compile * environment, line 3574: Called cmake-utils_src_compile * environment, line 1182: Called _cmake_execute_optionally 'src_compile' * environment, line 295: Called enable_cmake-utils_src_compile * environment, line 1482: Called cmake-utils_src_make * environment, line 1197: Called _cmake_ninja_src_make * environment, line 351: Called die * The specific snippet of code: * "$@" || die * * If you need support, post the output of `emerge --info '=sys-devel/clang-4.0.0_rc1::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-devel/clang-4.0.0_rc1::gentoo'`. * The complete build log is located at '/var/tmp/portage/sys-devel/clang-4.0.0_rc1/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-devel/clang-4.0.0_rc1/temp/environment'. * Working directory: '/var/tmp/portage/sys-devel/clang-4.0.0_rc1/work/cfe-4.0.0rc1.src-abi_x86_32.x86' * S: '/var/tmp/portage/sys-devel/clang-4.0.0_rc1/work/cfe-4.0.0rc1.src'
Note, USE="clang" sys-devel/llvm-3.9.1-r1 will compile successfully. # clang++ -v clang version 4.0.0 (tags/RELEASE_400/rc1) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4 Candidate multilib: .;@m64 Candidate multilib: 32;@m32 Selected multilib: .;@m64 # USE="clang" CC=clang CXX="clang++ -stdlib=libc++" ebuild llvm-3.9.1-r1.ebuild clean compile ... >>> Source compiled.
Could you paste a full run-through of package versions? I'm particular interested in libcxx* version used.
Created attachment 463390 [details] emerge --info (In reply to Michał Górny from comment #2) > Could you paste a full run-through of package versions? I'm particular > interested in libcxx* version used. The version of all packages except sys-libs/libcxxrt is 4.0.0_rc1. # USE="-doc libcxx" emerge -pv sys-devel/clang sys-devel/clang-runtime sys-libs/compiler-rt-sanitizers sys-libs/libcxx sys-libs/compiler-rt sys-libs/libomp sys-devel/llvm sys-libs/libcxxrt These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R #] sys-libs/libomp-4.0.0_rc1::gentoo USE="-hwloc -ompt {-test}" ABI_X86="32 (64) (-x32)" 0 KiB [ebuild R ~] sys-libs/libcxxrt-0.0_p20160922::gentoo USE="static-libs -libunwind" ABI_X86="32 (64) (-x32)" 0 KiB [ebuild R #] sys-devel/llvm-4.0.0_rc1:0/4::gentoo USE="libffi ncurses -debug -doc -gold -libedit -multitarget {-test}" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="AMDGPU BPF NVPTX (X86) -AArch64 -ARM -Hexagon -Lanai -MSP430 -Mips -PowerPC -RISCV -Sparc -SystemZ -XCore" 0 KiB [ebuild R #] sys-libs/compiler-rt-sanitizers-4.0.0_rc1:0/4.0::gentoo USE="{-test}" 0 KiB [ebuild R #] sys-libs/libcxx-4.0.0_rc1::gentoo USE="libcxxrt static-libs -libcxxabi -libunwind {-test}" ABI_X86="32 (64) (-x32)" 0 KiB [ebuild R #] sys-libs/compiler-rt-4.0.0_rc1:0/4.0::gentoo USE="{-test}" 0 KiB [ebuild R #] sys-devel/clang-runtime-4.0.0_rc1::gentoo USE="compiler-rt libcxx openmp sanitize" ABI_X86="32 (64) (-x32)" 0 KiB [ebuild R #] sys-devel/clang-4.0.0_rc1:0/4::gentoo USE="static-analyzer -debug -default-compiler-rt -default-libcxx -doc -multitarget -python {-test} -xml" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="AMDGPU BPF NVPTX (X86) -AArch64 -ARM -Hexagon -Lanai -MSP430 -Mips -PowerPC -RISCV -Sparc -SystemZ -XCore" PYTHON_TARGETS="python2_7" 0 KiB Total: 8 packages (8 reinstalls), Size of downloads: 0 KiB
I'm sorry but we can't provide proper support for multiple versions of LLVM packages. If you can still reproduce the problem with 7.0.1 series, please open a new bug.