Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtimes-build fails with many "undefined symbols" #59427

Open
liam-clink opened this issue Dec 9, 2022 · 3 comments
Open

runtimes-build fails with many "undefined symbols" #59427

liam-clink opened this issue Dec 9, 2022 · 3 comments
Labels

Comments

@liam-clink
Copy link

liam-clink commented Dec 9, 2022

Building release 15.0.6 from the tar file, and during the stage of building the runtimes, failure occurs due to many undefined symbols.
Building with llvm-15.0.3, build command

cmake -S ../llvm -B . -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_PROJECTS="bolt;llvm;clang;lld;lldb;clang-tools-extra;cross-project-tests;libclc;polly;pstl" -DLLVM_ENABLE_RUNTIMES="openmp;libcxx;libcxxabi;libunwind;compiler-rt" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLIBCXX_USE_COMPILER_RT=YES -DLLVM_USE_LINKER=lld -DLIBCXXABI_USE_LLVM_UNWINDER=YES -DLLVM_INSTALL_UTILS=ON -DCMAKE_INSTALL_PREFIX=$HOME/llvm15_temp -DLLDB_ENABLE_PYTHON=TRUE -DPython3_EXECUTABLE=`which python3` -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_ENABLE_LIBCXX=ON
Linking CXX shared library /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libomptarget.rtl.x86_64.so.15
FAILED: /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libomptarget.rtl.x86_64.so.15 
: && /home/liam/Downloads/llvm-project-15.0.6.src/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -Wcast-qual -Wformat-pedantic -Wimplicit-fallthrough -Wsign-compare -Wno-extra -Wno-pedantic -std=c++14 -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=lld -Wl,--color-diagnostics   -Wl,--gc-sections -shared -Wl,-soname,libomptarget.rtl.x86_64.so.15 -o /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libomptarget.rtl.x86_64.so.15 openmp/libomptarget/plugins/common/elf_common/CMakeFiles/elf_common.dir/elf_common.cpp.o openmp/libomptarget/plugins/x86_64/CMakeFiles/omptarget.rtl.x86_64.dir/home/liam/Downloads/llvm-project-15.0.6.src/openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp.o  -Wl,-rpath,"\$ORIGIN:/home/liam/Downloads/llvm-project-15.0.6.src/build/runtimes/runtimes-bins/openmp/libomptarget/plugins/x86_64/..:"  /usr/lib/x86_64-linux-gnu/libffi.so  /usr/lib/x86_64-linux-gnu/libelf.so  -ldl  -Wl,--version-script=/home/liam/Downloads/llvm-project-15.0.6.src/openmp/libomptarget/plugins/x86_64/../exports  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMBitReader.a  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMCore.a  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMRemarks.a  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMBitstreamReader.a  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMMCParser.a  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMMC.a  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMDebugInfoCodeView.a  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMTextAPI.a  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMBinaryFormat.a  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a  -lrt  -lm  /usr/lib/x86_64-linux-gnu/libz.so  /usr/lib/x86_64-linux-gnu/libtinfo.so  /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMDemangle.a  -ldl && :
ld.lld: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::assign(char const*)
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::object::ELFObjectFileBase::setARMSubArch(llvm::Triple&) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by ARMAttributeParser.cpp
>>>               ARMAttributeParser.cpp.o:(llvm::ARMAttributeParser::ABI_align_needed(llvm::ARMBuildAttrs::AttrType)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced by ARMAttributeParser.cpp
>>>               ARMAttributeParser.cpp.o:(llvm::ARMAttributeParser::ABI_align_preserved(llvm::ARMBuildAttrs::AttrType)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a

ld.lld: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::append(char const*)
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::object::ELFObjectFileBase::setARMSubArch(llvm::Triple&) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::object::ELFObjectFileBase::setARMSubArch(llvm::Triple&) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::Expected<llvm::ArrayRef<llvm::object::Elf_Sym_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>>>> llvm::object::ELFFile<llvm::object::ELFType<(llvm::support::endianness)1, false>>::getSectionContentsAsArray<llvm::object::Elf_Sym_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>>>(llvm::object::Elf_Shdr_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>> const&) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced 97 more times

ld.lld: error: undefined symbol: std::__1::error_code::message() const
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::object::ELFObjectFile<llvm::object::ELFType<(llvm::support::endianness)1, false>>::section_rel_end(llvm::object::DataRefImpl) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::object::ELFObjectFile<llvm::object::ELFType<(llvm::support::endianness)1, false>>::getRelocationOffset(llvm::object::DataRefImpl) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::object::ELFObjectFile<llvm::object::ELFType<(llvm::support::endianness)1, false>>::getRelocationSymbol(llvm::object::DataRefImpl) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced 29 more times

ld.lld: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::insert(unsigned long, char const*)
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::Expected<llvm::ArrayRef<llvm::object::Elf_Sym_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>>>> llvm::object::ELFFile<llvm::object::ELFType<(llvm::support::endianness)1, false>>::getSectionContentsAsArray<llvm::object::Elf_Sym_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>>>(llvm::object::Elf_Shdr_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>> const&) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::Expected<llvm::ArrayRef<llvm::object::Elf_Sym_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>>>> llvm::object::ELFFile<llvm::object::ELFType<(llvm::support::endianness)1, false>>::getSectionContentsAsArray<llvm::object::Elf_Sym_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>>>(llvm::object::Elf_Shdr_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>> const&) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::Expected<llvm::ArrayRef<llvm::object::Elf_Sym_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>>>> llvm::object::ELFFile<llvm::object::ELFType<(llvm::support::endianness)1, false>>::getSectionContentsAsArray<llvm::object::Elf_Sym_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>>>(llvm::object::Elf_Shdr_Impl<llvm::object::ELFType<(llvm::support::endianness)1, false>> const&) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced 102 more times

ld.lld: error: undefined symbol: std::__1::to_string(long)
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> llvm::object::getSecIndexForError<llvm::object::ELFType<(llvm::support::endianness)1, false>>(llvm::object::ELFFile<llvm::object::ELFType<(llvm::support::endianness)1, false>> const&, llvm::object::ELFType<(llvm::support::endianness)1, false>::Shdr const&)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> llvm::object::getSecIndexForError<llvm::object::ELFType<(llvm::support::endianness)0, false>>(llvm::object::ELFFile<llvm::object::ELFType<(llvm::support::endianness)0, false>> const&, llvm::object::ELFType<(llvm::support::endianness)0, false>::Shdr const&)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> llvm::object::getSecIndexForError<llvm::object::ELFType<(llvm::support::endianness)1, true>>(llvm::object::ELFFile<llvm::object::ELFType<(llvm::support::endianness)1, true>> const&, llvm::object::ELFType<(llvm::support::endianness)1, true>::Shdr const&)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced 1 more times

ld.lld: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::reserve(unsigned long)
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::toString(llvm::Error)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by raw_ostream.cpp
>>>               raw_ostream.cpp.o:(llvm::raw_string_ostream::reserveExtraSpace(unsigned long)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a

ld.lld: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::append(char const*, unsigned long)
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::toString(llvm::Error)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::toString(llvm::Error)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by ELFObjectFile.cpp
>>>               ELFObjectFile.cpp.o:(llvm::toString(llvm::Error)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced 6 more times

ld.lld: error: undefined symbol: std::__1::error_category::~error_category()
>>> referenced by Error.cpp
>>>               Error.cpp.o:(llvm::object::object_category()) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by Error.cpp
>>>               Error.cpp.o:((anonymous namespace)::_object_error_category::~_object_error_category()) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by Error.cpp
>>>               Error.cpp.o:(vtable for (anonymous namespace)::_object_error_category) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced 4 more times

ld.lld: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
>>> referenced by Error.cpp
>>>               Error.cpp.o:(llvm::ErrorInfoBase::message() const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by BitcodeReader.cpp
>>>               BitcodeReader.cpp.o:(void std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>::__push_back_slow_path<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMBitReader.a
>>> referenced by PrintPasses.cpp
>>>               PrintPasses.cpp.o:(llvm::cl::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, bool, llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>::handleOccurrence(unsigned int, llvm::StringRef, llvm::StringRef)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMCore.a
>>> referenced 1 more times

ld.lld: error: undefined symbol: std::__1::error_category::default_error_condition(int) const
>>> referenced by Error.cpp
>>>               Error.cpp.o:(vtable for (anonymous namespace)::_object_error_category) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by Error.cpp
>>>               Error.cpp.o:(vtable for (anonymous namespace)::ErrorErrorCategory) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a

ld.lld: error: undefined symbol: std::__1::error_category::equivalent(int, std::__1::error_condition const&) const
>>> referenced by Error.cpp
>>>               Error.cpp.o:(vtable for (anonymous namespace)::_object_error_category) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by Error.cpp
>>>               Error.cpp.o:(vtable for (anonymous namespace)::ErrorErrorCategory) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a

ld.lld: error: undefined symbol: std::__1::error_category::equivalent(std::__1::error_code const&, int) const
>>> referenced by Error.cpp
>>>               Error.cpp.o:(vtable for (anonymous namespace)::_object_error_category) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMObject.a
>>> referenced by Error.cpp
>>>               Error.cpp.o:(vtable for (anonymous namespace)::ErrorErrorCategory) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a

ld.lld: error: undefined symbol: std::__1::__shared_weak_count::__release_weak()
>>> referenced by DiagnosticHandler.cpp
>>>               DiagnosticHandler.cpp.o:((anonymous namespace)::PassRemarksOpt::~PassRemarksOpt()) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMCore.a
>>> referenced by DiagnosticHandler.cpp
>>>               DiagnosticHandler.cpp.o:(llvm::cl::opt<(anonymous namespace)::PassRemarksOpt, true, llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>::handleOccurrence(unsigned int, llvm::StringRef, llvm::StringRef)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMCore.a
>>> referenced by DiagnosticHandler.cpp
>>>               DiagnosticHandler.cpp.o:(llvm::cl::opt<(anonymous namespace)::PassRemarksOpt, true, llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>::setDefault()) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMCore.a

ld.lld: error: undefined symbol: std::__1::__shared_weak_count::~__shared_weak_count()
>>> referenced by DiagnosticHandler.cpp
>>>               DiagnosticHandler.cpp.o:(std::__1::__shared_ptr_emplace<llvm::Regex, std::__1::allocator<llvm::Regex>>::~__shared_ptr_emplace()) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMCore.a
>>> referenced by DiagnosticHandler.cpp
>>>               DiagnosticHandler.cpp.o:(std::__1::__shared_ptr_emplace<llvm::Regex, std::__1::allocator<llvm::Regex>>::~__shared_ptr_emplace()) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMCore.a

ld.lld: error: undefined symbol: std::__1::__shared_weak_count::__get_deleter(std::type_info const&) const
>>> referenced by DiagnosticHandler.cpp
>>>               DiagnosticHandler.cpp.o:(vtable for std::__1::__shared_ptr_emplace<llvm::Regex, std::__1::allocator<llvm::Regex>>) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMCore.a

ld.lld: error: undefined symbol: std::__1::generic_category()
>>> referenced by DataExtractor.cpp
>>>               DataExtractor.cpp.o:(llvm::DataExtractor::prepareRead(unsigned long, unsigned long, llvm::Error*) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced by DataExtractor.cpp
>>>               DataExtractor.cpp.o:(llvm::DataExtractor::getCStrRef(unsigned long*, llvm::Error*) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced by DataExtractor.cpp
>>>               DataExtractor.cpp.o:(llvm::DataExtractor::getULEB128(unsigned long*, llvm::Error*) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced 14 more times

ld.lld: error: undefined symbol: std::__1::__next_prime(unsigned long)
>>> referenced by ELFAttributeParser.cpp
>>>               ELFAttributeParser.cpp.o:(std::__1::pair<std::__1::__hash_iterator<std::__1::__hash_node<std::__1::__hash_value_type<unsigned int, unsigned int>, void*>*>, bool> std::__1::__hash_table<std::__1::__hash_value_type<unsigned int, unsigned int>, std::__1::__unordered_map_hasher<unsigned int, std::__1::__hash_value_type<unsigned int, unsigned int>, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, true>, std::__1::__unordered_map_equal<unsigned int, std::__1::__hash_value_type<unsigned int, unsigned int>, std::__1::equal_to<unsigned int>, std::__1::hash<unsigned int>, true>, std::__1::allocator<std::__1::__hash_value_type<unsigned int, unsigned int>>>::__emplace_unique_key_args<unsigned int, std::__1::pair<unsigned int, unsigned long>>(unsigned int const&, std::__1::pair<unsigned int, unsigned long>&&)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced by ELFAttributeParser.cpp
>>>               ELFAttributeParser.cpp.o:(std::__1::pair<std::__1::__hash_iterator<std::__1::__hash_node<std::__1::__hash_value_type<unsigned int, unsigned int>, void*>*>, bool> std::__1::__hash_table<std::__1::__hash_value_type<unsigned int, unsigned int>, std::__1::__unordered_map_hasher<unsigned int, std::__1::__hash_value_type<unsigned int, unsigned int>, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, true>, std::__1::__unordered_map_equal<unsigned int, std::__1::__hash_value_type<unsigned int, unsigned int>, std::__1::equal_to<unsigned int>, std::__1::hash<unsigned int>, true>, std::__1::allocator<std::__1::__hash_value_type<unsigned int, unsigned int>>>::__emplace_unique_key_args<unsigned int, std::__1::pair<unsigned int, unsigned long>>(unsigned int const&, std::__1::pair<unsigned int, unsigned long>&&)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced by ELFAttributeParser.cpp
>>>               ELFAttributeParser.cpp.o:(std::__1::pair<std::__1::__hash_iterator<std::__1::__hash_node<std::__1::__hash_value_type<unsigned int, llvm::StringRef>, void*>*>, bool> std::__1::__hash_table<std::__1::__hash_value_type<unsigned int, llvm::StringRef>, std::__1::__unordered_map_hasher<unsigned int, std::__1::__hash_value_type<unsigned int, llvm::StringRef>, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, true>, std::__1::__unordered_map_equal<unsigned int, std::__1::__hash_value_type<unsigned int, llvm::StringRef>, std::__1::equal_to<unsigned int>, std::__1::hash<unsigned int>, true>, std::__1::allocator<std::__1::__hash_value_type<unsigned int, llvm::StringRef>>>::__emplace_unique_key_args<unsigned int, std::__1::pair<unsigned int, llvm::StringRef>>(unsigned int const&, std::__1::pair<unsigned int, llvm::StringRef>&&)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced 3 more times

ld.lld: error: undefined symbol: std::__1::system_category()
>>> referenced by Error.cpp
>>>               Error.cpp.o:(llvm::errorToErrorCode(llvm::Error)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced by raw_ostream.cpp
>>>               raw_ostream.cpp.o:(llvm::raw_fd_ostream::raw_fd_ostream(llvm::StringRef, std::__1::error_code&, llvm::sys::fs::OpenFlags)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced by raw_ostream.cpp
>>>               raw_ostream.cpp.o:(llvm::raw_fd_ostream::raw_fd_ostream(int, bool, bool, llvm::raw_ostream::OStreamKind)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced 4 more times

ld.lld: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char>>(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
>>> referenced by Error.cpp
>>>               Error.cpp.o:(llvm::StringError::log(llvm::raw_ostream&) const) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a

ld.lld: error: undefined symbol: std::__1::mutex::lock()
>>> referenced by ErrorHandling.cpp
>>>               ErrorHandling.cpp.o:(llvm::report_fatal_error(llvm::Twine const&, bool)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced by ErrorHandling.cpp
>>>               ErrorHandling.cpp.o:(llvm::report_bad_alloc_error(char const*, bool)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a
>>> referenced by Process.cpp
>>>               Process.cpp.o:(llvm::sys::Process::FileDescriptorHasColors(int)) in archive /home/liam/Downloads/llvm-project-15.0.6.src/build/lib/libLLVMSupport.a

ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)

FAILED: runtimes/runtimes-stamps/runtimes-build /home/liam/Downloads/llvm-project-15.0.6.src/build/runtimes/runtimes-stamps/runtimes-build 
cd /home/liam/Downloads/llvm-project-15.0.6.src/build/runtimes/runtimes-bins && /usr/bin/cmake --build .
ninja: build stopped: subcommand failed.
@liam-clink
Copy link
Author

This does not happen when the -DLLVM_ENABLE_LIBCXX=ON option is omitted. Shouldn't llvm work better using it's own libc++ over libstdc++?

@layerkugou
Copy link

good thankyou

@Ultra-Code
Copy link

This seems to happen when parts of the project are built with different compilers. I just downloaded llvm-19.1.1, when building Zig and linking to the released llvm-19.1.1 it gives me similar errors. Using ldd on some of the objects, It seems they were built with gcc and linked to libstdc++ and the gcc runtime libgcc_s. But when building Zig it uses libc++ which leads to similar issues with symbol resolution.

@EugeneZelenko EugeneZelenko added the openmp:libomptarget OpenMP offload runtime label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants