rocksdb icon indicating copy to clipboard operation
rocksdb copied to clipboard

Add elf_aux_info() support for OpenBSD

Open brad0 opened this issue 1 year ago • 11 comments

brad0 avatar Aug 24 '24 01:08 brad0

Ping.

brad0 avatar Sep 06 '24 03:09 brad0

Ping.

brad0 avatar Sep 20 '24 21:09 brad0

cc @ajkr

brad0 avatar Sep 24 '24 09:09 brad0

Ping.

brad0 avatar Oct 12 '24 04:10 brad0

cc @adamretter

brad0 avatar Oct 25 '24 01:10 brad0

@brad0 I was able to checkout your branch and compile it. However, at the moment I keep running out of memory when running gmake check (I suspect that is unrelated to your change). My system (OpenBSD 7.6 x64) has 32GB or RAM and 16GB Swap file. Have you been able to run check?

adamretter avatar Oct 25 '24 18:10 adamretter

@adamretter You would have to use ulimit -d to increase the datasize. Make sure to add the user account to the staff login class. You can do so with usermod -L staff [user]. The default value is quite low.

I have not tried that. I tried running gmake check and it would not build on either amd64 or arm64 with the same linking issue..

  CCLD     db_bench
ld: error: undefined symbol: typeinfo for rocksdb::FileSystemWrapper
>>> referenced by simulated_hybrid_file_system.cc
>>>               tools/simulated_hybrid_file_system.o:(typeinfo for rocksdb::SimulatedHybridFileSystem)
>>> did you mean: vtable for rocksdb::FileSystemWrapper
>>> defined in: ./librocksdb.so

ld: error: undefined symbol: rocksdb::SyncPoint::GetInstance()
>>> referenced by mock_time_env.h:90 (./test_util/mock_time_env.h:90)
>>>               test_util/testutil.o:(rocksdb::MockSystemClock::TimedWait(rocksdb::port::CondVar*, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000000ll>>))
>>> referenced by mock_time_env.h:92 (./test_util/mock_time_env.h:92)
>>>               test_util/testutil.o:(rocksdb::MockSystemClock::TimedWait(rocksdb::port::CondVar*, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000000ll>>))
>>> referenced by mock_time_env.h:93 (./test_util/mock_time_env.h:93)
>>>               test_util/testutil.o:(rocksdb::MockSystemClock::TimedWait(rocksdb::port::CondVar*, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000000ll>>))

ld: error: undefined symbol: rocksdb::SyncPoint::Process(rocksdb::Slice const&, void*)
>>> referenced by sync_point.h:132 (./test_util/sync_point.h:132)
>>>               test_util/testutil.o:(rocksdb::MockSystemClock::TimedWait(rocksdb::port::CondVar*, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000000ll>>))
>>> referenced by sync_point.h:132 (./test_util/sync_point.h:132)
>>>               test_util/testutil.o:(rocksdb::MockSystemClock::TimedWait(rocksdb::port::CondVar*, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000000ll>>))
>>> referenced by sync_point.h:132 (./test_util/sync_point.h:132)
>>>               test_util/testutil.o:(rocksdb::MockSystemClock::TimedWait(rocksdb::port::CondVar*, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000000ll>>))

ld: error: undefined symbol: typeinfo for rocksdb::MemTableRep
>>> referenced by testutil.cc
>>>               test_util/testutil.o:(typeinfo for rocksdb::test::(anonymous namespace)::SpecialMemTableRep)

ld: error: undefined symbol: typeinfo for rocksdb::Customizable
>>> referenced by testutil.cc
>>>               test_util/testutil.o:(typeinfo for rocksdb::Comparator)
>>> referenced by testutil.cc
>>>               test_util/testutil.o:(typeinfo for rocksdb::CompactionFilter)
>>> referenced by testutil.cc
>>>               test_util/testutil.o:(typeinfo for rocksdb::CompactionFilterFactory)
>>> referenced 1 more times

ld: error: undefined symbol: typeinfo for rocksdb::MergeOperator
>>> referenced by testutil.cc
>>>               test_util/testutil.o:(typeinfo for rocksdb::test::ChanglingMergeOperator)

ld: error: undefined symbol: typeinfo for rocksdb::SystemClockWrapper
>>> referenced by testutil.cc
>>>               test_util/testutil.o:(typeinfo for rocksdb::MockSystemClock)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

brad0 avatar Oct 26 '24 01:10 brad0

@brad0 I don't get those errors. Instead I get this:

./db_bloom_filter_test >&t/log-db_bloom_filter_test

ld.so: db_bloom_filter_test: can't load library 'librocksdb.so.9.8'
Killed

adamretter avatar Oct 26 '24 15:10 adamretter

@brad0 I don't get those errors. Instead I get this:

./db_bloom_filter_test >&t/log-db_bloom_filter_test

ld.so: db_bloom_filter_test: can't load library 'librocksdb.so.9.8'
Killed

Is that the version that is built? so.9.8? It looks like the dynamic linker having difficulty finding the built copy of librocksdb. Where is it relative to the db_bloom_filter_test test?

brad0 avatar Oct 27 '24 23:10 brad0

@brad0 The files are all in: /home/openbsd/rocksdb

-rwxr-xr-x  1 openbsd  openbsd  9030080 Oct 26 08:49 db_bloom_filter_test
lrwxr-xr-x  1 openbsd  openbsd         19 Oct 26 08:48 librocksdb.so -> librocksdb.so.9.8.0
lrwxr-xr-x  1 openbsd  openbsd         19 Oct 26 08:48 librocksdb.so.9 -> librocksdb.so.9.8.0
lrwxr-xr-x  1 openbsd  openbsd         19 Oct 26 08:48 librocksdb.so.9.8 -> librocksdb.so.9.8.0
-rwxr-xr-x  1 openbsd  openbsd  155654080 Oct 26 08:48 librocksdb.so.9.8.0
-rw-r--r--  1 openbsd  openbsd  388336908 Oct 26 08:48 librocksdb_env_basic_test.a
-rw-r--r--  1 openbsd  openbsd    3368262 Oct 26 08:48 librocksdb_stress_debug.a
-rwxr-xr-x  1 openbsd  openbsd   10039960 Oct 26 08:48 librocksdb_test_debug.so
-rwxr-xr-x  1 openbsd  openbsd    6216600 Oct 26 08:48 librocksdb_tools_debug.so

Maybe this is helpful?

$ ldd db_bloom_filter_test
db_bloom_filter_test:
ld.so: db_bloom_filter_test: can't load library 'librocksdb_test_debug.so'
db_bloom_filter_test: signal 9

$ file db_bloom_filter_test
db_bloom_filter_test: ELF 64-bit LSB shared object, x86-64, version 1

$ ldd librocksdb_test_debug.so
librocksdb_test_debug.so:
Cannot load specified object
librocksdb_test_debug.so: exit status 1

$ file librocksdb_test_debug.so
librocksdb_test_debug.so: ELF 64-bit LSB shared object, x86-64, version 1

adamretter avatar Nov 04 '24 20:11 adamretter

@adamretter objdump -p on the same files.

brad0 avatar Nov 08 '24 22:11 brad0