From 867f05ded3634650f441e174becba23709913a95 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 9 Oct 2021 10:53:29 +0200 Subject: [PATCH] Avoid ASAN odr error like ==31311==ERROR: AddressSanitizer: odr-violation (0x7f3cda2e1480): [1] size=8 'provider_service_lz4' libservices/provider_service_lz4.c:14:17 [2] size=8 'provider_service_lz4' sql/sql_plugin_services.ic:301:33 --- include/providers/bzlib.h | 4 ++++ include/providers/lz4.h | 4 ++++ include/providers/lzma.h | 4 ++++ include/providers/lzo/lzo1x.h | 4 ++++ include/providers/snappy-c.h | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/include/providers/bzlib.h b/include/providers/bzlib.h index 70b180c6cbe..b48c940bdbc 100644 --- a/include/providers/bzlib.h +++ b/include/providers/bzlib.h @@ -12,6 +12,10 @@ extern "C" { #include #endif +#ifndef MYSQL_DYNAMIC_PLUGIN +#define provider_service_bzip2 provider_service_bzip2_static +#endif + #ifndef BZ_RUN #define BZ_RUN 0 #define BZ_FINISH 2 diff --git a/include/providers/lz4.h b/include/providers/lz4.h index ad0a9d1cf06..4ac6b2c8f0d 100644 --- a/include/providers/lz4.h +++ b/include/providers/lz4.h @@ -14,6 +14,10 @@ extern "C" { #include #endif +#ifndef MYSQL_DYNAMIC_PLUGIN +#define provider_service_lz4 provider_service_lz4_static +#endif + #ifndef LZ4_VERSION_NUMBER #define LZ4_MAX_INPUT_SIZE 0x7E000000 diff --git a/include/providers/lzma.h b/include/providers/lzma.h index 7dadf63a938..0ba04ede472 100644 --- a/include/providers/lzma.h +++ b/include/providers/lzma.h @@ -14,6 +14,10 @@ extern "C" { #include #endif +#ifndef MYSQL_DYNAMIC_PLUGIN +#define provider_service_lzma provider_service_lzma_static +#endif + #ifndef LZMA_VERSION typedef enum { diff --git a/include/providers/lzo/lzo1x.h b/include/providers/lzo/lzo1x.h index b1a9edd28d8..93d1461f9cb 100644 --- a/include/providers/lzo/lzo1x.h +++ b/include/providers/lzo/lzo1x.h @@ -12,6 +12,10 @@ extern "C" { #include #endif +#ifndef MYSQL_DYNAMIC_PLUGIN +#define provider_service_lzo provider_service_lzo_static +#endif + #ifndef LZO_E_OK #define LZO_E_OK 0 #define LZO_E_INTERNAL_ERROR (-99) diff --git a/include/providers/snappy-c.h b/include/providers/snappy-c.h index 579ad2a5b4a..afc6aef274c 100644 --- a/include/providers/snappy-c.h +++ b/include/providers/snappy-c.h @@ -13,6 +13,10 @@ extern "C" { #include #endif +#ifndef MYSQL_DYNAMIC_PLUGIN +#define provider_service_snappy provider_service_snappy_static +#endif + #ifndef SNAPPY_C typedef enum {