cmake: link memstore against os
This fixes the following linker error:
FAILED: bin/ceph-monstore-tool
: && /usr/lib64/ccache/clang++ -g -g -Wl,--export-dynamic -Xlinker --dependency-file=src/tools/CMakeFiles/ceph-monstore-tool.dir/link.d src/tools/CMakeFiles/ceph-monstore-tool.dir/ceph_monstore_tool.cc.o src/tools/CMakeFiles/ceph-monstore-tool.dir/__/auth/cephx/CephxKeyServer.cc.o src/tools/CMakeFiles/ceph-monstore-tool.dir/__/mgr/mgr_commands.cc.o -o bin/ceph-monstore-tool -Wl,-rpath,/work/ceph/build/lib: lib/libos.a lib/libglobal.a boost/lib/libboost_program_options.a lib/libmemstore.a lib/libkstore.a lib/libkv.a src/rocksdb/librocksdb.a /usr/lib64/libsnappy.so /usr/lib64/liblz4.so /usr/lib64/libz.so lib/libblk.a /lib64/libaio.so src/liburing/src/liburing.a lib/libheap_profiler.a /lib64/libtcmalloc.so lib/libfusestore.a /usr/lib64/libfuse.so lib/libceph-common.so.2 boost/lib/libboost_program_options.a lib/libfmtd.a src/opentelemetry-cpp/sdk/src/trace/libopentelemetry_trace.a src/opentelemetry-cpp/sdk/src/resource/libopentelemetry_resources.a src/opentelemetry-cpp/sdk/src/common/libopentelemetry_common.a src/opentelemetry-cpp/exporters/jaeger/libopentelemetry_exporter_jaeger_trace.a src/opentelemetry-cpp/ext/src/http/client/curl/libopentelemetry_http_client_curl.a /usr/lib64/libcurl.so /usr/lib64/libthrift.so lib/libjson_spirit.a lib/libcommon_utf8.a lib/liberasure_code.a lib/libextblkdev.a -lcap boost/lib/libboost_thread.a boost/lib/libboost_chrono.a boost/lib/libboost_atomic.a boost/lib/libboost_system.a boost/lib/libboost_random.a boost/lib/libboost_date_time.a boost/lib/libboost_iostreams.a boost/lib/libboost_regex.a /usr/lib64/libblkid.so /usr/lib64/libcrypto.so /usr/lib64/libudev.so /usr/lib64/libibverbs.so /usr/lib64/librdmacm.so /usr/lib64/libz.so src/breakpad_project-prefix/lib/libbreakpad_client.a -ldl /usr/lib64/librt.a -lresolv -Wl,--as-needed -latomic && :
/opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../bin/ld: lib/libmemstore.a(MemStore.cc.o): in function `MemStore::_do_transaction(ceph::os::Transaction&)':
/work/ceph/src/os/memstore/MemStore.cc:992:(.text+0xa074): undefined reference to `ceph::os::Transaction::dump(ceph::Formatter*)'
/opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../bin/ld: lib/libmemstore.a(MemStore.cc.o): in function `ceph::os::Transaction::iterator::decode_attrset_bl(ceph::buffer::v15_2_0::list*)':
/work/ceph/src/os/Transaction.h:753:(.text._ZN4ceph2os11Transaction8iterator17decode_attrset_blEPNS_6buffer7v15_2_04listE[_ZN4ceph2os11Transaction8iterator17decode_attrset_blEPNS_6buffer7v15_2_04listE]+0x1d): undefined reference to `decode_str_str_map_to_bl(ceph::buffer::v15_2_0::list::iterator_impl<true>&, ceph::buffer::v15_2_0::list*)'
/opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../bin/ld: lib/libmemstore.a(MemStore.cc.o): in function `ceph::os::Transaction::iterator::decode_keyset_bl(ceph::buffer::v15_2_0::list*)':
/work/ceph/src/os/Transaction.h:760:(.text._ZN4ceph2os11Transaction8iterator16decode_keyset_blEPNS_6buffer7v15_2_04listE[_ZN4ceph2os11Transaction8iterator16decode_keyset_blEPNS_6buffer7v15_2_04listE]+0x1d): undefined reference to `decode_str_set_to_bl(ceph::buffer::v15_2_0::list::iterator_impl<true>&, ceph::buffer::v15_2_0::list*)'
/opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../bin/ld: lib/libmemstore.a(MemStore.cc.o): in function `ObjectStore::~ObjectStore()':
/work/ceph/src/os/ObjectStore.h:248:(.text._ZN11ObjectStoreD2Ev[_ZN11ObjectStoreD2Ev]+0x13): undefined reference to `vtable for ObjectStore'
/opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../bin/ld: lib/libmemstore.a(MemStore.cc.o):(.data.rel.ro+0x1b0): undefined reference to `ObjectStore::write_meta(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&)'
/opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../bin/ld: lib/libmemstore.a(MemStore.cc.o):(.data.rel.ro+0x1b8): undefined reference to `ObjectStore::read_meta(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> >*)'
/opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../bin/ld: lib/libmemstore.a(MemStore.cc.o):(.data.rel.ro+0x2e8): undefined reference to `typeinfo for ObjectStore'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[352/548] Linking CXX executable bin/crimson-osd
ninja: build stopped: subcommand failed.
The above shows that MemStore is not being correctly linked against os.
I don't understand why this is not affecting most builds, but I can say it has been introduced
after the T release was split.
This change addresses a regression introduced by
5ab2e9fb.
Fixes: https://tracker.ceph.com/issues/72078
Signed-off-by: Alex Ainscow <aainscow@uk.ibm.com>