UPDATE: backport fix for newer fmt

This commit is contained in:
purplerain 2024-08-12 20:52:36 +00:00
parent bb2af63404
commit 66e409e585
Signed by: purplerain
GPG Key ID: F42C07F07E2E35B7
12 changed files with 181 additions and 8 deletions

View File

@ -5,7 +5,7 @@ COMMENT-tests= multithreaded SQL database (regression test suite/benchmark)
VERSION= 10.9.8
DISTNAME= mariadb-${VERSION}
PKGNAME-main= mariadb-client-${VERSION}
REVISION-server= 0
REVISION-server= 1
EPOCH= 1
CATEGORIES= databases
SITES= https://downloads.mariadb.com/MariaDB/${DISTNAME}/source/ \
@ -75,7 +75,7 @@ CONFIGURE_ARGS+=-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DINSTALL_SQLBENCHDIR="share/mysql-bench" \
-DINSTALL_SUPPORTFILESDIR="share/examples/mysql" \
-DMYSQL_UNIX_ADDR="${SOCKET_DIR}/mysql.sock" \
-DCOMPILATION_COMMENT='OpenBSD port: ${FULLPKGNAME-server}' \
-DCOMPILATION_COMMENT='SecBSD port: ${FULLPKGNAME-server}' \
-DPLUGIN_OQGRAPH=NO \
-DWITH_EXTERNAL_ZLIB=On \
-DWITH_PCRE=system \

View File

@ -0,0 +1,12 @@
Index: BUILD/check-cpu
--- BUILD/check-cpu.orig
+++ BUILD/check-cpu
@@ -140,7 +140,7 @@ check_cpu () {
# Fallback when there is no /proc/cpuinfo
CPUINFO=" "
case "`uname -s`" in
- FreeBSD|OpenBSD)
+ FreeBSD|OpenBSD|SecBSD)
cpu_family=`uname -m`;
model_name=`sysctl -n hw.model`
;;

View File

@ -0,0 +1,12 @@
Index: include/my_global.h
--- include/my_global.h.orig
+++ include/my_global.h
@@ -62,7 +62,7 @@
#define _POSIX_THREAD_CPUTIME
#endif /* __CYGWIN__ */
-#if defined(__OpenBSD__) && (OpenBSD >= 200411)
+#if defined(__SecBSD__) && (SecBSD >= 202404)
#define HAVE_ERRNO_AS_DEFINE
#endif

View File

@ -1,13 +1,31 @@
[PATCH] MDEV-31963 Fix libfmt usage in SFORMAT
- [PATCH] MDEV-31963 Fix libfmt usage in SFORMAT
`fmt::detail::make_arg` does not accept temporaries. Make it happy by
storing the format arg values in a temporary array first.
`fmt::detail::make_arg` does not accept temporaries. Make it happy by
storing the format arg values in a temporary array first.
cd5808eb8da13c5626d4bdeb452cef6ada29cb1d
cd5808eb8da13c5626d4bdeb452cef6ada29cb1d
- MDEV-34206 compile failure: fmt use incompatible with libfmt-10.2.[2]+
Upstream libfmt commit fmtlib/fmt@d707292
now requires the format function to be const.
Adjust the function prototype so it is const and can compile.
4375245d5d9f01cabb6e3fd6c637535e724eae38
Index: sql/item_strfunc.cc
--- sql/item_strfunc.cc.orig
+++ sql/item_strfunc.cc
@@ -1367,7 +1367,7 @@ bool Item_func_sformat::fix_length_and_dec(THD *thd)
namespace fmt {
template <> struct formatter<String>: formatter<string_view> {
template <typename FormatContext>
- auto format(String c, FormatContext& ctx) -> decltype(ctx.out()) {
+ auto format(String c, FormatContext& ctx) const -> decltype(ctx.out()) {
string_view name = { c.ptr(), c.length() };
return formatter<string_view>::format(name, ctx);
};
@@ -1382,11 +1382,24 @@ namespace fmt {
*/
String *Item_func_sformat::val_str(String *res)

View File

@ -17,3 +17,21 @@ Index: storage/rocksdb/CMakeLists.txt
# This plugin needs recent C++ compilers (it is using C++11 features)
# Skip build for the old compilers
SET(CXX11_FLAGS)
@@ -198,7 +189,7 @@ ADD_DEPENDENCIES(rocksdb_aux_lib GenError)
# MARIAROCKS-TODO: how to properly depend on -lrt ?
TARGET_LINK_LIBRARIES(rocksdb_aux_lib rocksdblib ${ZLIB_LIBRARY})
-if (UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+if (UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "SecBSD")
TARGET_LINK_LIBRARIES(rocksdb_aux_lib -lrt)
endif()
TARGET_LINK_LIBRARIES(rocksdb_aux_lib ${ATOMIC_EXTRA_LIBS})
@@ -249,7 +240,7 @@ ENDIF()
# ADD_SUBDIRECTORY(unittest)
#ENDIF()
-if (UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+if (UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "SecBSD")
SET(rocksdb_static_libs ${rocksdb_static_libs} "-lrt")
endif()

View File

@ -0,0 +1,12 @@
Index: storage/rocksdb/build_rocksdb.cmake
--- storage/rocksdb/build_rocksdb.cmake.orig
+++ storage/rocksdb/build_rocksdb.cmake
@@ -96,6 +96,8 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
add_definitions(-DOS_NETBSD)
elseif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
add_definitions(-DOS_OPENBSD)
+elseif(CMAKE_SYSTEM_NAME MATCHES "SecBSD")
+ add_definitions(-DOS_SECBSD)
elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly")
add_definitions(-DOS_DRAGONFLYBSD)
elseif(CMAKE_SYSTEM_NAME MATCHES "Android")

View File

@ -0,0 +1,12 @@
Index: storage/rocksdb/rocksdb/CMakeLists.txt
--- storage/rocksdb/rocksdb/CMakeLists.txt.orig
+++ storage/rocksdb/rocksdb/CMakeLists.txt
@@ -419,6 +419,8 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
add_definitions(-DOS_NETBSD)
elseif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
add_definitions(-DOS_OPENBSD)
+elseif(CMAKE_SYSTEM_NAME MATCHES "SecBSD")
+ add_definitions(-DOS_SECBSD)
elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly")
add_definitions(-DOS_DRAGONFLYBSD)
elseif(CMAKE_SYSTEM_NAME MATCHES "Android")

View File

@ -0,0 +1,19 @@
Index: storage/rocksdb/rocksdb/build_tools/build_detect_platform
--- storage/rocksdb/rocksdb/build_tools/build_detect_platform.orig
+++ storage/rocksdb/rocksdb/build_tools/build_detect_platform
@@ -205,6 +205,15 @@ EOF
FIND=gfind
WATCH=gnuwatch
;;
+ SecBSD)
+ PLATFORM=OS_SECBSD
+ CXX=clang++
+ COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp -D_REENTRANT -DOS_SECBSD"
+ PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -pthread"
+ # PORT_FILES=port/secbsd/secbsd_specific.cc
+ FIND=gfind
+ WATCH=gnuwatch
+ ;;
DragonFly)
PLATFORM=OS_DRAGONFLYBSD
COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp -D_REENTRANT -DOS_DRAGONFLYBSD"

View File

@ -0,0 +1,39 @@
Index: storage/rocksdb/rocksdb/env/fs_posix.cc
--- storage/rocksdb/rocksdb/env/fs_posix.cc.orig
+++ storage/rocksdb/rocksdb/env/fs_posix.cc
@@ -144,7 +144,7 @@ class PosixFileSystem : public FileSystem {
return IOStatus::IOError(fname,
"Direct I/O not supported in RocksDB lite");
#endif // !ROCKSDB_LITE
-#if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SOLARIS)
+#if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SECBSD) && !defined(OS_SOLARIS)
flags |= O_DIRECT;
#endif
}
@@ -196,7 +196,7 @@ class PosixFileSystem : public FileSystem {
return IOStatus::IOError(fname,
"Direct I/O not supported in RocksDB lite");
#endif // !ROCKSDB_LITE
-#if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SOLARIS)
+#if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SECBSD) && !defined(OS_SOLARIS)
flags |= O_DIRECT;
TEST_SYNC_POINT_CALLBACK("NewRandomAccessFile:O_DIRECT", &flags);
#endif
@@ -270,7 +270,7 @@ class PosixFileSystem : public FileSystem {
"Direct I/O not supported in RocksDB lite");
#endif // ROCKSDB_LITE
flags |= O_WRONLY;
-#if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SOLARIS)
+#if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SECBSD) && !defined(OS_SOLARIS)
flags |= O_DIRECT;
#endif
TEST_SYNC_POINT_CALLBACK("NewWritableFile:O_DIRECT", &flags);
@@ -363,7 +363,7 @@ class PosixFileSystem : public FileSystem {
"Direct I/O not supported in RocksDB lite");
#endif // !ROCKSDB_LITE
flags |= O_WRONLY;
-#if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SOLARIS)
+#if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SECBSD) && !defined(OS_SOLARIS)
flags |= O_DIRECT;
#endif
TEST_SYNC_POINT_CALLBACK("NewWritableFile:O_DIRECT", &flags);

View File

@ -0,0 +1,31 @@
Index: storage/rocksdb/rocksdb/port/port_posix.h
--- storage/rocksdb/rocksdb/port/port_posix.h.orig
+++ storage/rocksdb/rocksdb/port/port_posix.h
@@ -45,7 +45,7 @@
#define PLATFORM_IS_LITTLE_ENDIAN (BYTE_ORDER == LITTLE_ENDIAN)
#include <alloca.h>
#elif defined(OS_FREEBSD) || defined(OS_OPENBSD) || defined(OS_NETBSD) || \
- defined(OS_DRAGONFLYBSD) || defined(OS_ANDROID)
+ defined(OS_SECBSD) || defined(OS_DRAGONFLYBSD) || defined(OS_ANDROID)
#include <sys/endian.h>
#include <sys/types.h>
#define PLATFORM_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN)
@@ -65,7 +65,7 @@
#if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\
defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\
- defined(OS_ANDROID) || defined(CYGWIN) || defined(OS_AIX)
+ defined(OS_SECBSD) || defined(OS_ANDROID) || defined(CYGWIN) || defined(OS_AIX)
// Use fread/fwrite/fflush on platforms without _unlocked variants
#define fread_unlocked fread
#define fwrite_unlocked fwrite
@@ -73,7 +73,8 @@
#endif
#if defined(OS_MACOSX) || defined(OS_FREEBSD) ||\
- defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD)
+ defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\
+ defined(OS_SECBSD)
// Use fsync() on platforms without fdatasync()
#define fdatasync fsync
#endif

View File

@ -677,6 +677,7 @@ share/mysql/korean/
share/mysql/korean/errmsg.sys
share/mysql/maria_add_gis_sp.sql
share/mysql/maria_add_gis_sp_bootstrap.sql
%%rocksdb%%
share/mysql/mysql_performance_tables.sql
share/mysql/mysql_sys_schema.sql
share/mysql/mysql_system_tables.sql
@ -706,4 +707,3 @@ share/mysql/swedish/errmsg.sys
share/mysql/ukrainian/
share/mysql/ukrainian/errmsg.sys
%%le%%
%%rocksdb%%

View File

@ -3764,6 +3764,7 @@ share/mysql-test/plugin/metadata_lock_info/metadata_lock_info/t/
share/mysql-test/plugin/metadata_lock_info/metadata_lock_info/t/global_read_lock.test
share/mysql-test/plugin/metadata_lock_info/metadata_lock_info/t/table_metadata_lock.test
share/mysql-test/plugin/metadata_lock_info/metadata_lock_info/t/user_lock.test
%%rocksdb%%
share/mysql-test/plugin/myisam/
share/mysql-test/plugin/myisam/mtr2/
share/mysql-test/plugin/myisam/mtr2/README
@ -17174,4 +17175,3 @@ share/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf
share/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test
share/mysql-test/valgrind.supp
%%le%%
%%rocksdb%%