ronchaine / llvm-project

Guess I'll try to do something useful with llvm here
http://llvm.org
0 stars 0 forks source link

Cannot compile self-hosted with LTO #1

Open ronchaine opened 4 years ago

ronchaine commented 4 years ago

Trying to use LLVM_ENABLE_LTO=FULL results in

ld.lld: error: undefined symbol: llvm::errs()
>>> referenced by ld-temp.o
>>>               lto.tmp:(_GLOBAL__sub_I_TableGen.cpp)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::AsmMatcherEmitter::run(llvm::raw_ostream&))
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::AsmMatcherEmitter::run(llvm::raw_ostream&))
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::AsmMatcherEmitter::run(llvm::raw_ostream&))
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::AsmMatcherEmitter::run(llvm::raw_ostream&))
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::validate(llvm::StringRef, bool) const)
>>> referenced 92 more times

ld.lld: error: undefined symbol: llvm::cl::Option::error(llvm::Twine const&, llvm::StringRef, llvm::raw_ostream&)
>>> referenced by ld-temp.o
>>>               lto.tmp:(_GLOBAL__sub_I_TableGen.cpp)
>>> referenced by ld-temp.o
>>>               lto.tmp:(llvm::cl::opt<ActionType, false, llvm::cl::parser<ActionType> >::handleOccurrence(unsigned int, llvm::StringRef, llvm::StringRef))

ld.lld: error: undefined symbol: vtable for llvm::cl::Option
>>> referenced by ld-temp.o
>>>               lto.tmp:(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())
>>> referenced by ld-temp.o
>>>               lto.tmp:(llvm::cl::opt<unsigned int, false, llvm::cl::parser<unsigned int> >::~opt())
>>> referenced by ld-temp.o
>>>               lto.tmp:(llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::~opt())
>>> referenced by ld-temp.o
>>>               lto.tmp:(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> > > >::~list())
>>> referenced by ld-temp.o
>>>               lto.tmp:(llvm::cl::opt<ActionType, false, llvm::cl::parser<ActionType> >::~opt())
>>> referenced by ld-temp.o
>>>               lto.tmp:(llvm::cl::opt<bool, true, llvm::cl::parser<bool> >::~opt())
>>> referenced by ld-temp.o
>>>               lto.tmp:(llvm::cl::opt<bool, true, llvm::cl::parser<bool> >::~opt())
>>> referenced by ld-temp.o
>>>               lto.tmp:(llvm::cl::opt<ActionType, false, llvm::cl::parser<ActionType> >::~opt())
the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)

ld.lld: error: undefined symbol: llvm::raw_ostream::write(char const*, unsigned long)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced by ld-temp.o
>>>               lto.tmp:((anonymous namespace)::MatchableInfo::dump() const)
>>> referenced 6466 more times

LLVM_ENABLE_LTO=Thin results in different, but similar errors