]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: link only radosgw with ALLOC_LIBS
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 1 Nov 2023 17:16:46 +0000 (13:16 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Wed, 1 Nov 2023 19:58:56 +0000 (15:58 -0400)
In particular, do not link intermediate dependencies nor librgw.so.2
with a custom allocator (normally tcmalloc).

This prevents illegal behavior due to mismatched allocators when run
under nfs-ganesha or other consumers.

Fixes: https://tracker.ceph.com/issues/63394
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/CMakeLists.txt

index 9b55081dbaaad965403a7f480c08f0c77be97786..e4ff8c9199bcc7cade4c397cbe9732952703e347 100644 (file)
@@ -279,7 +279,6 @@ target_link_libraries(rgw_common
     ${ARROW_LIBRARIES}
     ${ARROW_FLIGHT_LIBRARIES}
     ${LMDB_LIBRARIES}
-    ${ALLOC_LIBS}
   PUBLIC
     ${LUA_LIBRARIES}
     RapidJSON::RapidJSON
@@ -459,7 +458,12 @@ target_include_directories(radosgw
 
 target_include_directories(radosgw SYSTEM PUBLIC "../rapidjson/include")
 
-target_link_libraries(radosgw PRIVATE ${rgw_libs} rgw_schedulers kmip)
+target_link_libraries(radosgw PRIVATE
+  ${rgw_libs}
+  rgw_schedulers
+  kmip
+  ${ALLOC_LIBS})
+
 if(WITH_RADOSGW_BEAST_OPENSSL)
   # used by rgw_asio_frontend.cc
   target_link_libraries(radosgw PRIVATE OpenSSL::SSL)
@@ -509,7 +513,7 @@ set(radosgw_token_srcs
   rgw_token.cc)
 add_executable(radosgw-token ${radosgw_token_srcs})
 target_link_libraries(radosgw-token librados
-  global ${ALLOC_LIBS})
+  global)
 install(TARGETS radosgw-token DESTINATION bin)
 
 set(radosgw_object_expirer_srcs