]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
build: Add `cls_timeindex_types` to `cls_timeindex` objclass 68912/head
authorAdam C. Emerson <aemerson@redhat.com>
Wed, 22 Apr 2026 04:37:32 +0000 (00:37 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 15 May 2026 21:54:46 +0000 (17:54 -0400)
`cls_timeindex_entry` defines `encode()` and `decode()` inline in
`cls_timeindex_types.h`, but `dump()` and `generate_test_instances()` are
defined out of line in `cls_timeindex_types.cc`. That `.cc` was compiled
only into `cls_timeindex_client`, not into the `cls_timeindex objclass`
shared library. At `-O2` the optimizer inlines and dead-code-eliminates
these unused `dump()` paths, so `cls_timeindex.so` ends up with no
reference to the out-of-line symbols and loads fine. At `-O0` nothing is
inlined or eliminated: the header-inline `dump()` is emitted and leaves
an undefined reference to `cls_timeindex_entry::dump()` in
`cls_timeindex.so`, so `dlopen()` of the objclass fails at load time.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/cls/CMakeLists.txt

index ad5c71c51b6d518eb18251727c9265d26f8073c2..cfcc2f8679069309d4a1f870e53b4fac3aef4fff 100644 (file)
@@ -147,7 +147,7 @@ add_library(cls_log_client STATIC ${cls_log_client_srcs})
 
 
 # cls_timeindex
-set(cls_timeindex_srcs timeindex/cls_timeindex.cc)
+set(cls_timeindex_srcs timeindex/cls_timeindex.cc timeindex/cls_timeindex_types.cc)
 add_library(cls_timeindex SHARED ${cls_timeindex_srcs})
 set_target_properties(cls_timeindex PROPERTIES
   VERSION "1.0.0"