git: 6d631ac4b25d - main - databases/xtrabackup8: fix build for i386

From: Eugene Grosbein <eugen_at_FreeBSD.org>
Date: Fri, 10 Mar 2023 10:46:40 UTC
The branch main has been updated by eugen:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6d631ac4b25d4357f91ce4a28c7c776631cbcf0d

commit 6d631ac4b25d4357f91ce4a28c7c776631cbcf0d
Author:     Eugene Grosbein <eugen@FreeBSD.org>
AuthorDate: 2023-03-10 10:43:38 +0000
Commit:     Eugene Grosbein <eugen@FreeBSD.org>
CommitDate: 2023-03-10 10:46:31 +0000

    databases/xtrabackup8: fix build for i386
    
    Improve alignment fix and backport small code change
    from MySQL 8.0.32 codebase to fix build for i386.
    
    Fixes:  d06e12de9aeccfddb388561466ef833a2906d39e
---
 databases/xtrabackup8/Makefile                     |  2 +-
 .../files/patch-storage_innobase_log__log0recv.cc  | 29 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/databases/xtrabackup8/Makefile b/databases/xtrabackup8/Makefile
index c38b83ce5ee1..0a9a58b0f62a 100644
--- a/databases/xtrabackup8/Makefile
+++ b/databases/xtrabackup8/Makefile
@@ -62,7 +62,7 @@ WRKSRC=		${WRKDIR}/${PPORTNAME}-${PPORTNAME}-${DVERSION}
 # which is broken on i386 due to different size of types and causes a
 # 'static_assert(alignof(T) <= alignof(std::max_align_t))' error
 .if ${ARCH} == i386
-CMAKE_ARGS+=	-DDISABLE_PSI_MEMORY=1
+CXXFLAGS+=	-malign-double
 .endif
 
 KEEP_EXTRA=	lz4 robin-hood-hashing zlib
diff --git a/databases/xtrabackup8/files/patch-storage_innobase_log__log0recv.cc b/databases/xtrabackup8/files/patch-storage_innobase_log__log0recv.cc
new file mode 100644
index 000000000000..ad9388decfa4
--- /dev/null
+++ b/databases/xtrabackup8/files/patch-storage_innobase_log__log0recv.cc
@@ -0,0 +1,29 @@
+--- storage/innobase/log/log0recv.cc.orig	2023-01-30 20:34:34.000000000 +0700
++++ storage/innobase/log/log0recv.cc	2023-03-10 12:08:29.586971000 +0700
+@@ -3789,7 +3789,7 @@ static bool recv_scan_log_recs(log_t &log,
+ #else  /* !UNIV_HOTBACKUP */
+ bool meb_scan_log_recs(
+ #endif /* !UNIV_HOTBACKUP */
+-                               size_t *max_memory, const byte *buf, size_t len,
++                               size_t max_memory, const byte *buf, size_t len,
+                                lsn_t start_lsn, lsn_t *read_upto_lsn,
+                                dberr_t &err, lsn_t to_lsn) {
+   const byte *log_block = buf;
+@@ -4066,7 +4066,7 @@ bool meb_scan_log_recs(
+     recv_parse_log_recs();
+ 
+ #ifndef UNIV_HOTBACKUP
+-    if (recv_heap_used() > *max_memory) {
++    if (recv_heap_used() > max_memory) {
+       recv_apply_hashed_log_recs(log, false);
+     }
+ #endif /* !UNIV_HOTBACKUP */
+@@ -4254,7 +4254,7 @@ static dberr_t recv_recovery_begin(log_t &log, const l
+ 
+     dberr_t err;
+ 
+-    finished = recv_scan_log_recs(log, &max_mem, log.buf, end_lsn - start_lsn,
++    finished = recv_scan_log_recs(log, max_mem, log.buf, end_lsn - start_lsn,
+                                   start_lsn, &log.m_scanned_lsn, err, to_lsn);
+ 
+     if (err != DB_SUCCESS) {