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

Cannot compile self-hosted with LTO #1

Open
ronchaine opened this issue Mar 13, 2020 · 0 comments
Open

Cannot compile self-hosted with LTO #1

ronchaine opened this issue Mar 13, 2020 · 0 comments
Assignees
Labels
Investigate A bug or not? LLVM Concerns LLVM component

Comments

@ronchaine
Copy link
Owner

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

@ronchaine ronchaine changed the title [LLVM] Cannot compile self-hosted with full LTO [LLVM] Cannot compile self-hosted with LTO Mar 13, 2020
@ronchaine ronchaine self-assigned this Mar 13, 2020
@ronchaine ronchaine added the Investigate A bug or not? label Mar 13, 2020
@ronchaine ronchaine changed the title [LLVM] Cannot compile self-hosted with LTO Cannot compile self-hosted with LTO Mar 14, 2020
@ronchaine ronchaine added the LLVM Concerns LLVM component label Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate A bug or not? LLVM Concerns LLVM component
Projects
None yet
Development

No branches or pull requests

1 participant