diff -ur mysql-8.0.35.orig/plugin/group_replication/libmysqlgcs/CMakeLists.txt mysql-8.0.35/plugin/group_replication/libmysqlgcs/CMakeLists.txt --- mysql-8.0.35.orig/plugin/group_replication/libmysqlgcs/CMakeLists.txt 2023-12-17 22:05:20.830721323 +0100 +++ mysql-8.0.35/plugin/group_replication/libmysqlgcs/CMakeLists.txt 2023-12-17 22:07:25.296271792 +0100 @@ -137,7 +137,6 @@ src/bindings/xcom/gcs_xcom_statistics_interface.cc src/bindings/xcom/gcs_xcom_proxy.cc src/bindings/xcom/gcs_xcom_communication_protocol_changer.cc - ${BUNDLED_LZ4_PATH}/xxhash.c # required by gcs_message_stage_split src/bindings/xcom/gcs_message_stage_split.cc src/bindings/xcom/gcs_xcom_synode.cc src/bindings/xcom/gcs_xcom_expels_in_progress.cc) @@ -230,6 +229,7 @@ # Dependency on mysys from gcs_logging_system.cc # but pick up symbols from the server: # TARGET_LINK_LIBRARIES(mysqlgcs mysys) +TARGET_LINK_LIBRARIES(mysqlgcs xxhash) IF(LINUX AND WITH_TIRPC STREQUAL "bundled") ADD_DEPENDENCIES(mysqlgcs tirpc_ext) diff -ur mysql-8.0.35.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc mysql-8.0.35/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc --- mysql-8.0.35.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc 2023-12-17 22:05:20.832721348 +0100 +++ mysql-8.0.35/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc 2023-12-17 22:07:25.295271780 +0100 @@ -126,7 +126,7 @@ std::string info(node.get_member_id().get_member_id()); info.append(node.get_member_uuid().actual_value); - return GCS_XXH64(info.c_str(), info.size(), 0); + return XXH64(info.c_str(), info.size(), 0); } bool Gcs_message_stage_split_v2::update_members_information( diff -ur mysql-8.0.35.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h mysql-8.0.35/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h --- mysql-8.0.35.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h 2023-12-17 22:05:20.834721373 +0100 +++ mysql-8.0.35/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h 2023-12-17 22:07:25.296271792 +0100 @@ -25,10 +25,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -// Define a namespace prefix to all xxhash functions. This is done to -// avoid conflict with xxhash symbols in liblz4. -#define XXH_NAMESPACE GCS_ - -#include "xxhash.h" +#include #endif // GCS_XXHASH_H_INCLUDED diff -ur mysql-8.0.35.orig/sql/CMakeLists.txt mysql-8.0.35/sql/CMakeLists.txt --- mysql-8.0.35.orig/sql/CMakeLists.txt 2023-12-17 22:05:21.077724399 +0100 +++ mysql-8.0.35/sql/CMakeLists.txt 2023-12-17 22:08:35.180142336 +0100 @@ -762,7 +762,6 @@ ${CONF_SOURCES} ${SQL_SHARED_SOURCES} ${SQL_HEADERS} - ${BUNDLED_LZ4_PATH}/xxhash.c ../libmysql/errmsg.cc ../sql-common/client.cc ../sql-common/client_plugin.cc @@ -818,11 +817,6 @@ ) ENDIF() -MY_ADD_COMPILE_DEFINITIONS( - ${BUNDLED_LZ4_PATH}/xxhash.c - COMPILE_DEFINITIONS XXH_NAMESPACE=MY_ - ) - # Workaround for Apple Clang bug on ARM. # When linking mysqld (and executables using server_unittest_library) # we get linker warnings about @@ -847,13 +841,6 @@ ) ENDIF() -ADD_COMPILE_FLAGS( - ${BUNDLED_LZ4_PATH}/xxhash.c - iterators/hash_join_iterator.cc - rpl_write_set_handler.cc - COMPILE_FLAGS -I${CMAKE_SOURCE_DIR}/extra/lz4 -I${BUNDLED_LZ4_PATH} - ) - # Fixes "C1128: number of sections exceeded object file format limit" in MSVC IF(WIN32) ADD_COMPILE_FLAGS( @@ -941,7 +928,7 @@ ADD_DEPENDENCIES(sql_main GenSysSchema) TARGET_LINK_LIBRARIES(sql_main ${MYSQLD_STATIC_PLUGIN_LIBS} mysql_server_component_services mysys strings vio - binlogevents_static ${LIBWRAP} ${LIBDL} ${SSL_LIBRARIES} + binlogevents_static xxhash ${LIBWRAP} ${LIBDL} ${SSL_LIBRARIES} extra::rapidjson) # sql/immutable_string.h uses diff -ur mysql-8.0.35.orig/sql/iterators/hash_join_iterator.cc mysql-8.0.35/sql/iterators/hash_join_iterator.cc --- mysql-8.0.35.orig/sql/iterators/hash_join_iterator.cc 2023-12-17 22:05:21.366728000 +0100 +++ mysql-8.0.35/sql/iterators/hash_join_iterator.cc 2023-12-17 22:07:25.297271805 +0100 @@ -32,7 +32,7 @@ #include "field_types.h" #include "my_alloc.h" #include "my_bit.h" -#include "my_xxhash.h" +#include #include "my_inttypes.h" #include "my_sys.h" @@ -307,7 +307,7 @@ const uint64_t join_key_hash = join_key_and_row_buffer->length() == 0 ? kZeroKeyLengthHash - : MY_XXH64(join_key_and_row_buffer->ptr(), + : XXH64(join_key_and_row_buffer->ptr(), join_key_and_row_buffer->length(), xxhash_seed); assert((chunks->size() & (chunks->size() - 1)) == 0); diff -ur mysql-8.0.35.orig/sql/rpl_write_set_handler.cc mysql-8.0.35/sql/rpl_write_set_handler.cc --- mysql-8.0.35.orig/sql/rpl_write_set_handler.cc 2023-12-17 22:05:21.611731051 +0100 +++ mysql-8.0.35/sql/rpl_write_set_handler.cc 2023-12-17 22:07:25.297271805 +0100 @@ -37,7 +37,7 @@ #include "my_dbug.h" #include "my_inttypes.h" #include "my_murmur3.h" // murmur3_32 -#include "my_xxhash.h" // IWYU pragma: keep +#include #include "mysql_com.h" #include "sql-common/json_binary.h" #include "sql-common/json_dom.h" @@ -75,7 +75,7 @@ if (algorithm == HASH_ALGORITHM_MURMUR32) return (murmur3_32((const uchar *)T, len, 0)); else - return (MY_XXH64((const uchar *)T, len, 0)); + return (XXH64((const uchar *)T, len, 0)); } #ifndef NDEBUG diff -ur mysql-8.0.35.orig/unittest/gunit/hash_join-t.cc mysql-8.0.35/unittest/gunit/hash_join-t.cc --- mysql-8.0.35.orig/unittest/gunit/hash_join-t.cc 2023-12-17 22:05:25.668781591 +0100 +++ mysql-8.0.35/unittest/gunit/hash_join-t.cc 2023-12-17 22:08:05.509772732 +0100 @@ -37,7 +37,7 @@ #include "my_config.h" #include "my_inttypes.h" #include "my_murmur3.h" -#include "my_xxhash.h" +#include #include "mysql/components/services/bits/psi_bits.h" #include "prealloced_array.h" #include "sql/field.h" @@ -226,7 +226,7 @@ size_t sum = 0; for (size_t i = 0; i < num_iterations; ++i) { - sum += MY_XXH64(&data[0], data.size(), 0); + sum += XXH64(&data[0], data.size(), 0); } StopBenchmarkTiming(); @@ -245,7 +245,7 @@ size_t sum = 0; for (size_t i = 0; i < num_iterations; ++i) { - sum += MY_XXH64(&data[0], data.size(), 0); + sum += XXH64(&data[0], data.size(), 0); } StopBenchmarkTiming(); diff -ur mysql-8.0.35.orig/unittest/gunit/innodb/ut0rnd-t.cc mysql-8.0.35/unittest/gunit/innodb/ut0rnd-t.cc --- mysql-8.0.35.orig/unittest/gunit/innodb/ut0rnd-t.cc 2023-12-17 22:05:25.830783608 +0100 +++ mysql-8.0.35/unittest/gunit/innodb/ut0rnd-t.cc 2023-12-17 22:07:25.298271817 +0100 @@ -33,7 +33,7 @@ #include "storage/innobase/include/ut0crc32.h" #include "storage/innobase/include/ut0rnd.h" -#include "my_xxhash.h" +#include namespace innodb_ut0rnd_unittest {