Skip to content

Xcode project does not link with homebrew LLVM #240

Open
@jaivia

Description

@jaivia

All other steps seem to work fine but linking fails. All steps from instructions were followed. Here's snippet of linker error:

Undefined symbols for architecture arm64:
"std::__1::basic_stringbuf<char, std::__1::char_traits, std::__1::allocator >::str() const", referenced from:
(anonymous namespace)::AVRAsmParser::validateTargetOperandClass(llvm::MCParsedAsmOperand&, unsigned int) in libLLVMAVRAsmParser.a(AVRAsmParser.cpp.o)
llvm::NVPTXRegisterInfo::getName(unsigned int) const in libLLVMNVPTXCodeGen.a(NVPTXAsmPrinter.cpp.o)
(anonymous namespace)::AsmParser::parseStatement((anonymous namespace)::ParseStatementInfo&, llvm::MCAsmParserSemaCallback*) in libLLVMMCParser.a(AsmParser.cpp.o)
(anonymous namespace)::InstrOrderFile::run(llvm::Module&) in libLLVMInstrumentation.a(InstrOrderFile.cpp.o)
llvm::NVPTXTargetLowering::getPrototype(llvm::DataLayout const&, llvm::Type*, std::__1::vector<llvm::TargetLoweringBase::ArgListEntry, std::__1::allocatorllvm::TargetLoweringBase::ArgListEntry > const&, llvm::SmallVectorImplllvm::ISD::OutputArg const&, llvm::MaybeAlign, llvm::CallBase const&) const in libLLVMNVPTXCodeGen.a(NVPTXISelLowering.cpp.o)
llvm::inlineCostStr(llvm::InlineCost const&) in libLLVMAnalysis.a(InlineAdvisor.cpp.o)
getStatString(char const*, int, int, char const*, bool) in libLLVMTransformUtils.a(ImportedFunctionsInliningStatistics.cpp.o)
...
"VTT for std::__1::basic_stringstream<char, std::__1::char_traits, std::__1::allocator >", referenced from:
llvm::NVPTXRegisterInfo::getName(unsigned int) const in libLLVMNVPTXCodeGen.a(NVPTXAsmPrinter.cpp.o)
(anonymous namespace)::HexagonAsmBackend::HandleFixupError(int, int, long long, char const*) const in libLLVMHexagonDesc.a(HexagonAsmBackend.cpp.o)
(anonymous namespace)::InstrOrderFile::run(llvm::Module&) in libLLVMInstrumentation.a(InstrOrderFile.cpp.o)
llvm::NVPTXTargetLowering::getPrototype(llvm::DataLayout const&, llvm::Type*, std::__1::vector<llvm::TargetLoweringBase::ArgListEntry, std::__1::allocatorllvm::TargetLoweringBase::ArgListEntry > const&, llvm::SmallVectorImplllvm::ISD::OutputArg const&, llvm::MaybeAlign, llvm::CallBase const&) const in libLLVMNVPTXCodeGen.a(NVPTXISelLowering.cpp.o)
llvm::inlineCostStr(llvm::InlineCost const&) in libLLVMAnalysis.a(InlineAdvisor.cpp.o)
getStatString(char const*, int, int, char const*, bool) in libLLVMTransformUtils.a(ImportedFunctionsInliningStatistics.cpp.o)
llvm::MachO::InterfaceFile::addUUID(llvm::MachO::Target const&, unsigned char*) in libLLVMTextAPI.a(InterfaceFile.cpp.o)

Research shows points to this being due to gcc compiling included libs with stdlib and apple clang not. How is this resolved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions