Allow to build on FreeBSD pre-12.x and i386 by stealing some patches

from the `databases/mysql80-server' port.

Suggested by:	fluffy
This commit is contained in:
Alexey Dokuchaev
2020-11-12 10:19:17 +00:00
parent bbccc71d6e
commit fbb475acff
2 changed files with 28 additions and 1 deletions
+11 -1
View File
@@ -39,13 +39,23 @@ CMAKE_ARGS= -DBUILD_CONFIG:STRING=xtrabackup_release
CMAKE_ARGS+= -DWITH_${component}:STRING=system
.endfor
post-patch:
# Since MySQL 8.0.20 InnoDB engine uses new memory alligned allocator
# 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
.endif
post-extract:
# Delete bundled components so we won't accidentally use them, except LZ4
# which cannot be removed just yet
@${MV} ${WRKSRC}/extra/lz4 ${WRKSRC}
@${RM} -r ${WRKSRC}/extra/*
@${MV} ${WRKSRC}/lz4 ${WRKSRC}/extra
post-patch:
@${REINPLACE_CMD} -e 's,TRUE,true,' ${WRKSRC}/sql/mysqld.cc
post-stage:
@${RM} -r ${STAGEDIR}${PREFIX}/docs
@${RMDIR} ${STAGEDIR}${PREFIX}/lib/plugin/debug
@@ -0,0 +1,17 @@
--- storage/temptable/include/temptable/lock_free_type.h.orig 2020-06-16 16:31:03 UTC
+++ storage/temptable/include/temptable/lock_free_type.h
@@ -31,6 +31,14 @@ Lock-free type (selection) implementation. */
#include "storage/temptable/include/temptable/constants.h"
+#if defined(__i386__) //&& defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)
+/* Fix for clang setting __GCC_ATOMIC_LLONG_LOCK_FREE incorecctly for x86
+ * https://llvm.org/bugs/show_bug.cgi?id=19355
+ */
+#undef ATOMIC_LLONG_LOCK_FREE
+#define ATOMIC_LLONG_LOCK_FREE 2
+#endif
+
namespace temptable {
/** Enum class describing alignment-requirements. */