From: Matt Benjamin Date: Wed, 1 Nov 2023 17:16:46 +0000 (-0400) Subject: rgw: link only radosgw with ALLOC_LIBS X-Git-Tag: v18.2.5~150^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=67972caf076a57b9667aa94e48df12866c11c25a;p=ceph.git rgw: link only radosgw with ALLOC_LIBS 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 (cherry picked from commit c4b4ba554d285d9342cf16e4ce6782f18bd405ce) --- diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index b010f303ab8..c5dc9d78ae8 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -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