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

Can't compile (linking error "plugin needed to handle lto object" in ixwebsocket and leveldb) #393

Open
Ur-Quan opened this issue Jun 24, 2022 · 1 comment

Comments

@Ur-Quan
Copy link

Ur-Quan commented Jun 24, 2022

Hi. As subject says. Did git clone --recursive. Ubuntu 18.10, g++ 9. Here's trimmed output:

[ 29%] Linking CXX static library libixwebsocket.a /usr/bin/ar: CMakeFiles/ixwebsocket.dir/ixwebsocket/IXBench.cpp.o: plugin needed to handle lto object ...... /usr/bin/ar: CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketTransport.cpp.o: plugin needed to handle lto object /usr/bin/ranlib: libixwebsocket.a(IXBench.cpp.o): plugin needed to handle lto object ...... /usr/bin/ranlib: libixwebsocket.a(IXWebSocketTransport.cpp.o): plugin needed to handle lto object [ 29%] Built target ixwebsocket ...... [ 61%] Linking CXX static library libleveldb.a /usr/bin/ar: CMakeFiles/leveldb.dir/db/builder.cc.o: plugin needed to handle lto object ...... /usr/bin/ar: CMakeFiles/leveldb.dir/helpers/memenv/memenv.cc.o: plugin needed to handle lto object /usr/bin/ranlib: libleveldb.a(builder.cc.o): plugin needed to handle lto object ...... /usr/bin/ranlib: libleveldb.a(memenv.cc.o): plugin needed to handle lto object [ 61%] Built target leveldb ...... [ 99%] Linking CXX executable novacoind /tmp/novacoind.KiPcMa.ltrans0.ltrans.o: In function std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >, ix::CaseInsensitiveLess, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits, std::allocator >&&>, std::tuple<> >(std::_Rb_tree_const_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >, std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits, std::allocator >&&>&&, std::tuple<>&&) [clone .constprop.0]':
:(.text+0x522c): undefined reference to ix::CaseInsensitiveLess::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' <artificial>:(.text+0x5254): undefined reference to ix::CaseInsensitiveLess::operator()(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
:(.text+0x52e6): undefined reference to ix::CaseInsensitiveLess::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' <artificial>:(.text+0x531c): undefined reference to ix::CaseInsensitiveLess::operator()(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
:(.text+0x535c): undefined reference to ix::CaseInsensitiveLess::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /tmp/novacoind.KiPcMa.ltrans0.ltrans.o:<artificial>:(.text+0x53cc): more undefined references to ix::CaseInsensitiveLess::operator()(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const' follow
/tmp/novacoind.KiPcMa.ltrans0.ltrans.o: In function _sub_I_65535_0.261768': <artificial>:(.text.startup+0x19e8): undefined reference to DbEnv::DbEnv(unsigned int)'
/tmp/novacoind.KiPcMa.ltrans1.ltrans.o: In function CTxDB::WriteVersion(int) [clone .constprop.0]': <artificial>:(.text+0x7681): undefined reference to leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&)'
:(.text+0x7819): undefined reference to leveldb::Status::ToString[abi:cxx11]() const' /tmp/novacoind.KiPcMa.ltrans1.ltrans.o: In function bool CDB::Write<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, CPubKey>, CKeyMetadata>(std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, CPubKey> const&, CKeyMetadata const&, bool) [clone .constprop.0]':
:(.text+0x79a0): undefined reference to Dbt::Dbt(void*, unsigned int)' <artificial>:(.text+0x7a21): undefined reference to Dbt::Dbt(void*, unsigned int)'
:(.text+0x7a71): undefined reference to Dbt::~Dbt()' <artificial>:(.text+0x7a9b): undefined reference to Dbt::~Dbt()'
/tmp/novacoind.KiPcMa.ltrans1.ltrans.o: In function bool CDB::Write<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int const&, bool) [clone .constprop.0]': <artificial>:(.text+0x7be5): undefined reference to Dbt::Dbt(void*, unsigned int)'
:(.text+0x7c41): undefined reference to Dbt::Dbt(void*, unsigned int)' <artificial>:(.text+0x7c90): undefined reference to Dbt::~Dbt()'
:(.text+0x7cba): undefined reference to Dbt::~Dbt()' /tmp/novacoind.KiPcMa.ltrans1.ltrans.o: In function CDBEnv::Open(boost::filesystem::path) [clone .constprop.0]':
:(.text+0x7f14): undefined reference to DbEnv::set_lg_dir(char const*)' <artificial>:(.text+0x7f4f): undefined reference to DbEnv::set_cachesize(unsigned int, unsigned int, int)'
:(.text+0x7f60): undefined reference to DbEnv::set_lg_bsize(unsigned int)' <artificial>:(.text+0x7f71): undefined reference to DbEnv::set_lg_max(unsigned int)'
:(.text+0x7f82): undefined reference to DbEnv::set_lk_max_locks(unsigned int)' <artificial>:(.text+0x7f93): undefined reference to DbEnv::set_lk_max_objects(unsigned int)'
:(.text+0x7fb3): undefined reference to DbEnv::set_errfile(_IO_FILE*)' <artificial>:(.text+0x7fc9): undefined reference to DbEnv::set_flags(unsigned int, int)'
:(.text+0x7fdf): undefined reference to DbEnv::set_flags(unsigned int, int)' <artificial>:(.text+0x7ff5): undefined reference to DbEnv::log_set_config(unsigned int, int)'
:(.text+0x8010): undefined reference to DbEnv::open(char const*, unsigned int, int)' <artificial>:(.text+0x8073): undefined reference to DbEnv::strerror(int)'..
......
:(.text+0x7230): undefined reference to ix::HttpClient::~HttpClient()' /tmp/novacoind.KiPcMa.ltrans37.ltrans.o: In function std::unique_ptr<ix::HttpServer, std::default_deleteix::HttpServer >::~unique_ptr()':
:(.text+0x51e1): undefined reference to ix::HttpServer::~HttpServer()' /tmp/novacoind.KiPcMa.ltrans37.ltrans.o: In function CommandLineRPC(int, char**) [clone .cold]':
:(.text.unlikely+0x1b31): undefined reference to ix::HttpClient::~HttpClient()' collect2: error: ld returned 1 exit status CMakeFiles/novacoind.dir/build.make:900: recipe for target 'novacoind' failed make[2]: *** [novacoind] Error 1 CMakeFiles/Makefile2:120: recipe for target 'CMakeFiles/novacoind.dir/all' failed make[1]: *** [CMakeFiles/novacoind.dir/all] Error 2 Makefile:135: recipe for target 'all' failed make: *** [all] Error 2

@CryptoManiac
Copy link
Contributor

CryptoManiac commented Jul 15, 2022

Hi. It is probably caused by a change of compiler defaults in g++, looks like it is using slim objects instead of fat. I believe that addition of -ffat-lto-objects option to CXXFLAGS and CFLAGS will resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants