commit:     da2c810401729b1a07b7ab94d09a4214c064c951
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  9 08:35:02 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun  9 08:35:02 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da2c8104

dev-db/mariadb: fix build w/ USE=-debug

Not an ideal fix (see upstream bugs for discussion) without a bit
more investigation on the bigger problem but this is the lesser evil.

Closes: https://bugs.gentoo.org/949720
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-db/mariadb/files/mariadb-10.6.21-debug.patch | 24 ++++++++++++++++++++++++
 dev-db/mariadb/mariadb-10.6.21.ebuild            |  1 +
 dev-db/mariadb/mariadb-10.6.22.ebuild            |  1 +
 3 files changed, 26 insertions(+)

diff --git a/dev-db/mariadb/files/mariadb-10.6.21-debug.patch 
b/dev-db/mariadb/files/mariadb-10.6.21-debug.patch
new file mode 100644
index 000000000000..ec8ae7617c12
--- /dev/null
+++ b/dev-db/mariadb/files/mariadb-10.6.21-debug.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/949720
+https://jira.mariadb.org/browse/MDEV-36036
+https://jira.mariadb.org/browse/MDEV-36113
+--- a/storage/innobase/include/trx0trx.h
++++ b/storage/innobase/include/trx0trx.h
+@@ -671,14 +671,18 @@
+   {
+     ut_ad(!mutex_is_owner());
+     mutex.wr_lock();
++#ifdef UNIV_DEBUG
+     assert(!mutex_owner.exchange(pthread_self(),
+                                  std::memory_order_relaxed));
++#endif /* UNIV_DEBUG */
+   }
+   /** Release the mutex */
+   void mutex_unlock()
+   {
++#ifdef UNIV_DEBUG
+     assert(mutex_owner.exchange(0, std::memory_order_relaxed) ==
+            pthread_self());
++#endif /* UNIV_DEBUG */
+     mutex.wr_unlock();
+   }
+ #ifndef SUX_LOCK_GENERIC

diff --git a/dev-db/mariadb/mariadb-10.6.21.ebuild 
b/dev-db/mariadb/mariadb-10.6.21.ebuild
index cf9ee82527b1..3c07406d88c4 100644
--- a/dev-db/mariadb/mariadb-10.6.21.ebuild
+++ b/dev-db/mariadb/mariadb-10.6.21.ebuild
@@ -227,6 +227,7 @@ src_prepare() {
        eapply "${FILESDIR}"/${PN}-10.6.11-gssapi.patch
        eapply "${FILESDIR}"/${PN}-10.6.12-gcc-13.patch
        eapply "${WORKDIR}"/${PN}-10.6-columnstore-with-boost-1.85.patch
+       eapply "${FILESDIR}"/${PN}-10.6.21-debug.patch
 
        eapply_user
 

diff --git a/dev-db/mariadb/mariadb-10.6.22.ebuild 
b/dev-db/mariadb/mariadb-10.6.22.ebuild
index 786cbb02d32a..b5650aa5e4a7 100644
--- a/dev-db/mariadb/mariadb-10.6.22.ebuild
+++ b/dev-db/mariadb/mariadb-10.6.22.ebuild
@@ -227,6 +227,7 @@ src_prepare() {
        eapply "${FILESDIR}"/${PN}-10.6.11-gssapi.patch
        eapply "${FILESDIR}"/${PN}-10.6.12-gcc-13.patch
        eapply "${WORKDIR}"/${PN}-10.6-columnstore-with-boost-1.85.patch
+       eapply "${FILESDIR}"/${PN}-10.6.21-debug.patch
 
        eapply_user
 

Reply via email to