diff --git a/proxysql-gcc11.patch b/proxysql-gcc11.patch new file mode 100644 index 0000000..dfeb25c --- /dev/null +++ b/proxysql-gcc11.patch @@ -0,0 +1,51 @@ +diff --git a/deps/Makefile b/deps/Makefile +index 6f049c8..6b0b6ea 100644 +--- a/deps/Makefile ++++ b/deps/Makefile +@@ -119,6 +119,8 @@ mariadb-client-library/mariadb_client/libmariadb/libmariadbclient.a: + # cd mariadb-client-library/mariadb_client && patch libmariadb/ma_pvio.c < ../ma_pvio.c.patch + cd mariadb-client-library/mariadb_client && patch unittest/libmariadb/basic-t.c < ../unittest_basic-t.c.patch + cd mariadb-client-library/mariadb_client && patch unittest/libmariadb/charset.c < ../unittest_charset.c.patch ++ cd mariadb-client-library/mariadb_client && patch include/ma_global.h < ../ma_global.h.patch ++ cd mariadb-client-library/mariadb_client && patch libmariadb/ma_compress.c < ../ma_compress.c.patch + cd mariadb-client-library/mariadb_client && CC=${CC} CXX=${CXX} ${MAKE} mariadbclient + # cd mariadb-client-library/mariadb_client/include && make my_config.h + +diff --git a/deps/mariadb-client-library/ma_compress.c.patch b/deps/mariadb-client-library/ma_compress.c.patch +new file mode 100644 +index 0000000..a50c412 +--- /dev/null ++++ b/deps/mariadb-client-library/ma_compress.c.patch +@@ -0,0 +1,13 @@ ++diff --git a/libmariadb/ma_compress.c b/libmariadb/ma_compress.c ++index 55184a0..a16bb8a 100644 ++--- a/libmariadb/ma_compress.c +++++ b/libmariadb/ma_compress.c ++@@ -64,7 +64,7 @@ unsigned char *_mariadb_compress_alloc(const unsigned char *packet, size_t *len, ++ free(compbuf); ++ return 0; ++ } ++- swap(size_t,*len,*complen); /* *len is now packet length */ +++ my_swap(size_t,*len,*complen); /* *len is now packet length */ ++ return compbuf; ++ } ++ +diff --git a/deps/mariadb-client-library/ma_global.h.patch b/deps/mariadb-client-library/ma_global.h.patch +new file mode 100644 +index 0000000..e0d14b2 +--- /dev/null ++++ b/deps/mariadb-client-library/ma_global.h.patch +@@ -0,0 +1,13 @@ ++diff --git a/include/ma_global.h b/include/ma_global.h ++index d1fec39..3d476bb 100644 ++--- a/include/ma_global.h +++++ b/include/ma_global.h ++@@ -272,7 +272,7 @@ typedef unsigned short ushort; ++ #endif ++ ++ #define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0) ++-#define swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; } +++#define my_swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; } ++ #define test(a) ((a) ? 1 : 0) ++ #define set_if_bigger(a,b) { if ((a) < (b)) (a)=(b); } ++ #define set_if_smaller(a,b) { if ((a) > (b)) (a)=(b); } diff --git a/proxysql.spec b/proxysql.spec index 850195c..6c48bb6 100644 --- a/proxysql.spec +++ b/proxysql.spec @@ -1,7 +1,7 @@ Summary: A high-performance MySQL proxy Name: proxysql Version: 2.0.13 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.proxysql.com/ # The entire source code is GPLv3+ except deps/re2 and deps/jemalloc which is BSD # and deps/mariadb-connector-c which is LGPLv2+ @@ -53,6 +53,7 @@ Source2: proxysql.1 # Patch provides debundling bundled libraries Patch0: proxysql_debundle.patch Patch1: libinjection_python2_to_3.patch +Patch2: %{name}-gcc11.patch %description ProxySQL is a high performance, high availability, protocol aware proxy for MySQL and forks (like Percona Server and MariaDB). @@ -60,6 +61,7 @@ MySQL and forks (like Percona Server and MariaDB). %prep %setup -q %patch0 -p1 +%patch2 -p1 rm -rf deps/libconfig deps/libdaemon deps/sqlite3 # Remove sources of debundled libraries from v2.0.7 @@ -112,6 +114,10 @@ install -d -m 0755 %{buildroot}%{_sharedstatedir}/proxysql %config(noreplace) %{_sysconfdir}/%{name}.cnf %changelog +* Fri Dec 04 2020 Jeff Law - 2.0.13-2 +- Replace "swap" in mariadb library with my_swap to avoid conflict with C++ + standard headers + * Tue Aug 04 2020 Filip Januš - 2.0.13-1 - Rebase onto version 2.0.13 - Add new patch to port bundled libinjection to python 3