Current behaviour
Building with the --with-experimental-kernel-lib configuration option currently leads to linker failures on OpenBSD 7.2. The following compiler/linker/build-tool versions are used:
- clang 13.0.0
- lld 13.0.0
- ccache 4.6.3
- GNU make 4.3
- autoconf 2.71
- automake 1.16.5
Expected behaviour
- Building should succeed
Steps to reproduce
$ ./configure --enable-suppress-external-warnings --with-experimental-kernel-lib MAKE=gmake
[ ... ]
$ gmake clean
$ gmake -j8
[ ... ]
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for leveldb_comparator_t; recompile with -fPIC
>>> defined in leveldb/.libs/libleveldb.a(libleveldb_la-c.o)
>>> referenced by c.cc:87 (leveldb/db/c.cc:87)
>>> libleveldb_la-c.o:(leveldb_comparator_create) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for leveldb_filterpolicy_t; recompile with -fPIC
>>> defined in leveldb/.libs/libleveldb.a(libleveldb_la-c.o)
>>> referenced by c.cc:107 (leveldb/db/c.cc:107)
>>> libleveldb_la-c.o:(leveldb_filterpolicy_create) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for leveldb_filterpolicy_t; recompile with -fPIC
>>> defined in leveldb/.libs/libleveldb.a(libleveldb_la-c.o)
>>> referenced by c.cc:108 (leveldb/db/c.cc:108)
>>> libleveldb_la-c.o:(leveldb_filterpolicy_create_bloom::Wrapper::~Wrapper()) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for leveldb_filterpolicy_t; recompile with -fPIC
>>> defined in leveldb/.libs/libleveldb.a(libleveldb_la-c.o)
>>> referenced by c.cc:108 (leveldb/db/c.cc:108)
>>> libleveldb_la-c.o:(leveldb_filterpolicy_create_bloom::Wrapper::~Wrapper()) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for leveldb_comparator_t; recompile with -fPIC
>>> defined in leveldb/.libs/libleveldb.a(libleveldb_la-c.o)
>>> referenced by c.cc:88 (leveldb/db/c.cc:88)
>>> libleveldb_la-c.o:(leveldb_comparator_t::~leveldb_comparator_t()) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for leveldb_comparator_t; recompile with -fPIC
>>> defined in leveldb/.libs/libleveldb.a(libleveldb_la-c.o)
>>> referenced by c.cc:88 (leveldb/db/c.cc:88)
>>> libleveldb_la-c.o:(leveldb_comparator_t::~leveldb_comparator_t()) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for leveldb_filterpolicy_t; recompile with -fPIC
>>> defined in leveldb/.libs/libleveldb.a(libleveldb_la-c.o)
>>> referenced by c.cc:108 (leveldb/db/c.cc:108)
>>> libleveldb_la-c.o:(leveldb_filterpolicy_t::~leveldb_filterpolicy_t()) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for leveldb_filterpolicy_t; recompile with -fPIC
>>> defined in leveldb/.libs/libleveldb.a(libleveldb_la-c.o)
>>> referenced by c.cc:108 (leveldb/db/c.cc:108)
>>> libleveldb_la-c.o:(leveldb_filterpolicy_t::~leveldb_filterpolicy_t()) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol construction vtable for std::__1::basic_ostream<char, std::__1::char_traits<char> >-in-std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >; recompile with -fPIC
>>> defined in .libs/libbitcoinkernel_la-chain.o
>>> referenced by ostream:165 (/usr/include/c++/v1/ostream:165)
>>> libleveldb_la-dbformat.o:(leveldb::ParsedInternalKey::DebugString() const) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol construction vtable for std::__1::basic_ostream<char, std::__1::char_traits<char> >-in-std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >; recompile with -fPIC
>>> defined in .libs/libbitcoinkernel_la-chain.o
>>> referenced by ostream:165 (/usr/include/c++/v1/ostream:165)
>>> libleveldb_la-dbformat.o:(leveldb::ParsedInternalKey::DebugString() const) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >; recompile with -fPIC
ar>, std::__1::allocator<char> >; recompile with -fPIC
>>> defined in .libs/libbitcoinkernel_la-chain.o
>>> referenced by iosfwd:139 (/usr/include/c++/v1/iosfwd:139)
>>> libleveldb_la-dbformat.o:(leveldb::ParsedInternalKey::DebugString() const) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for std::__1::basic_stringbuf<char, std::__1::char_traits<char>,
std::__1::allocator<char> >; recompile with -fPIC
>>> defined in .libs/libbitcoinkernel_la-chain.o
>>> referenced by iosfwd:133 (/usr/include/c++/v1/iosfwd:133)
>>> libleveldb_la-dbformat.o:(leveldb::ParsedInternalKey::DebugString() const) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol VTT for std::__1::basic_ostringstream<char, std::__1::char_traits<char>
, std::__1::allocator<char> >; recompile with -fPIC
>>> defined in .libs/libbitcoinkernel_la-chain.o
>>> referenced by iosfwd:139 (/usr/include/c++/v1/iosfwd:139)
>>> libleveldb_la-dbformat.o:(leveldb::ParsedInternalKey::DebugString() const) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for std::__1::basic_ostringstream<char, std::__1::char_traits<ch
ar>, std::__1::allocator<char> >; recompile with -fPIC
>>> defined in .libs/libbitcoinkernel_la-chain.o
>>> referenced by iosfwd:139 (/usr/include/c++/v1/iosfwd:139)
>>> libleveldb_la-dbformat.o:(leveldb::ParsedInternalKey::DebugString() const) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for std::__1::basic_ostringstream<char, std::__1::char_traits<ch
ar>, std::__1::allocator<char> >; recompile with -fPIC
>>> defined in .libs/libbitcoinkernel_la-chain.o
>>> referenced by iosfwd:139 (/usr/include/c++/v1/iosfwd:139)
>>> libleveldb_la-dbformat.o:(leveldb::ParsedInternalKey::DebugString() const) in archive leveldb/.libs/libleveldb.a
ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable for std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >; recompile with -fPIC
>>> defined in .libs/libbitcoinkernel_la-chain.o
>>> referenced by iosfwd:133 (/usr/include/c++/v1/iosfwd:133)
>>> libleveldb_la-dbformat.o:(leveldb::ParsedInternalKey::DebugString() const) in archive leveldb/.libs/libleveldb.a
ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [Makefile:7030: libbitcoinkernel.la] Error 1
gmake[1]: *** [Makefile:19397: all-recursive] Error 1
gmake: *** [Makefile:814: all-recursive] Error 1
Relevant log output
The ./configure output can be found here: https://pastebin.com/XzrZKe7D
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
master branch (commit 40d0b0a524dfe8cc70cc116a6c76a3f834824fe5)
Operating system and version
OpenBSD 7.2 (amd64)
Machine specifications
No response