]> 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)
committerIgor Fedotov <igor.fedotov@croit.io>
Thu, 14 Nov 2024 11:47:41 +0000 (14:47 +0300)
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>
(cherry picked from commit c4b4ba554d285d9342cf16e4ce6782f18bd405ce)

src/rgw/CMakeLists.txt

index b010f303ab883c0b3faa125f0ea67cf6a80b1b40..c5dc9d78ae8ddfd42d8f43b9b58cc5dabe82ca2a 100644 (file)
@@ -263,7 +263,6 @@ target_link_libraries(rgw_common
     ${EXPAT_LIBRARIES}
     ${ARROW_LIBRARIES}
     ${ARROW_FLIGHT_LIBRARIES}
-    ${ALLOC_LIBS}
   PUBLIC
     ${LUA_LIBRARIES}
     RapidJSON::RapidJSON
@@ -435,7 +434,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)
@@ -485,7 +489,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