From 2b4fb55ea3dd74b2edae35c5af413309afe42f33 Mon Sep 17 00:00:00 2001 From: Christopher Brannon Date: Sat, 2 May 2020 07:31:16 -0700 Subject: [PATCH] mariadb: add a patch to fix an issue on musl. Sourced from: https://github.com/MariaDB/server/commit/1655053ac1 --- .../mariadb/patches/fix-pthread-detach.patch | 34 +++++++++++++++++++ srcpkgs/mariadb/template | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/mariadb/patches/fix-pthread-detach.patch diff --git a/srcpkgs/mariadb/patches/fix-pthread-detach.patch b/srcpkgs/mariadb/patches/fix-pthread-detach.patch new file mode 100644 index 00000000000..a53c05b1320 --- /dev/null +++ b/srcpkgs/mariadb/patches/fix-pthread-detach.patch @@ -0,0 +1,34 @@ +From c45b4a774b6d1404a080a1c1759f780fa78f223b Mon Sep 17 00:00:00 2001 +From: Sergey Vojtovich +Date: Fri, 21 Sep 2018 16:04:16 +0400 +Subject: [PATCH] MDEV-17200 - pthread_detach called for already detached + threads + +pthread_detach_this_thread() was intended to be defined to something +meaningful only on some ancient unixes, which don't have +pthread_attr_setdetachstate() defined. Otherwise, on normal unixes, +threads are created detached in the first place. + +This was broken in 0f01bf267680244ec488adaf65a42838756ed48e so that +we started calling pthread_detach() for already detached threads. +Intention was to detach aria checkpoint thread. + +However in 87007dc2f71634cc460271eb277ad851ec69c04b aria service threads +were made joinable with appropriate handling, which makes breaking +revision unneccessary. + +Revert remnants of 0f01bf267680244ec488adaf65a42838756ed48e, so that +pthread_detach_this_thread() is meaningful only on some ancient unixes +again. + +--- include/my_pthread.h ++++ include/my_pthread.h +@@ -184,7 +184,7 @@ int pthread_cancel(pthread_t thread); + #define pthread_key(T,V) pthread_key_t V + #define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V)) + #define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V)) +-#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } ++#define pthread_detach_this_thread() + #define pthread_handler_t EXTERNC void * + typedef void *(* pthread_handler)(void *); + diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template index c0c44217b71..157024b9652 100644 --- a/srcpkgs/mariadb/template +++ b/srcpkgs/mariadb/template @@ -1,7 +1,7 @@ # Template file for 'mariadb' pkgname=mariadb version=10.1.30 -revision=7 +revision=8 build_style=cmake configure_args="-DMYSQL_DATADIR=/var/lib/mysql -DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock -DDEFAULT_CHARSET=utf8