Skip to contentSkip to conversation

mariadb: Upgrade to 10.6.4

PATCH New Khem Raj 1 participant 1 message Aug 23, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 mariadb: Upgrade to 10.6.4

From: Mingli Yu <[email protected]>

Drop patches such as 0001-disable-ucontext-on-musl.patch is used to patch include/my_context.h which is deleted in 10.6.x [1] and rebase one patch to avoid fuzz warnings.

[1] https://github.com/MariaDB/server/commit/32a29afea777d8bbfcea7a2b5e6e5ee674013cb5

---
v2: Fix rv32 build failures

 ...ve_10.5.11.bb => mariadb-native_10.6.4.bb} |  0
 meta-oe/recipes-dbs/mysql/mariadb.inc         |  6 ++--
 ...ck-if-syscall-exists-before-using-it.patch | 14 ++++----
 .../0001-disable-ucontext-on-musl.patch       | 26 ---------------
 .../clang_version_header_conflict.patch       | 32 -------------------
 .../mysql/mariadb/ppc-remove-glibc-dep.patch  | 19 +++--------
 .../recipes-dbs/mysql/mariadb/sys_futex.patch | 27 ++++++++--------
 .../{mariadb_10.5.11.bb => mariadb_10.6.4.bb} |  0
 8 files changed, 28 insertions(+), 96 deletions(-)
 rename meta-oe/recipes-dbs/mysql/{mariadb-native_10.5.11.bb => mariadb-native_10.6.4.bb} (100%)
 delete mode 100644 meta-oe/recipes-dbs/mysql/mariadb/0001-disable-ucontext-on-musl.patch
 delete mode 100644 meta-oe/recipes-dbs/mysql/mariadb/clang_version_header_conflict.patch
 rename meta-oe/recipes-dbs/mysql/{mariadb_10.5.11.bb => mariadb_10.6.4.bb} (100%)
meta-oe/recipes-dbs/mysql/mariadb-native_10.6.4.bb renamed from meta-oe/recipes-dbs/mysql/mariadb-native_10.5.11.bb +0 -0
similarity index 100%
rename from meta-oe/recipes-dbs/mysql/mariadb-native_10.5.11.bb
rename to meta-oe/recipes-dbs/mysql/mariadb-native_10.6.4.bb
meta-oe/recipes-dbs/mysql/mariadb.inc +2 -4
index 2496ac8fdc..81a7859323 100644
@@ -12,20 +12,18 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
            file://mysql-systemd-start \
            file://configure.cmake-fix-valgrind.patch \
            file://support-files-CMakeLists.txt-fix-do_populate_sysroot.patch \
-           file://0001-disable-ucontext-on-musl.patch \
            file://c11_atomics.patch \
-           file://clang_version_header_conflict.patch \
            file://fix-arm-atomic.patch \
            file://0001-Fix-library-LZ4-lookup.patch \
            file://0001-innobase-Define-__NR_futex-if-it-does-not-exist.patch \
            file://0001-aio_linux-Check-if-syscall-exists-before-using-it.patch \
-           file://sys_futex.patch \
            file://ssize_t.patch \
            file://mm_malloc.patch \
+           file://sys_futex.patch \
           "
 SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch"
 
-SRC_URI[sha256sum] = "761053605fe30ce393f324852117990350840a93b3e6305ef4d2f8c8305cc47a"
+SRC_URI[sha256sum] = "75bf9b147a95d38160d01a73b098d50a1960563b46d16a235971fff64d99643c"
 
 UPSTREAM_CHECK_URI = "https://github.com/MariaDB/server/releases"
 
meta-oe/recipes-dbs/mysql/mariadb/0001-aio_linux-Check-if-syscall-exists-before-using-it.patch +7 -7
index a2f7812c50..6ed174113b 100644
@@ -1,6 +1,6 @@
-From 5d9a869a72420cf0bb08b6aa93e980df90bdcf2e Mon Sep 17 00:00:00 2001
+From 0a3222338efc108c831fbdd719a47d35f4b0adcd Mon Sep 17 00:00:00 2001
 From: Khem Raj <[email protected]>
-Date: Sat, 3 Apr 2021 12:02:36 -0700
+Date: Wed, 18 Aug 2021 06:49:25 +0000
 Subject: [PATCH] aio_linux: Check if syscall exists before using it
 
 Return -ENOSYS if not implememented, fixes build on arches like RISCV32
@@ -17,10 +17,10 @@ Signed-off-by: Khem Raj <[email protected]>
  1 file changed, 4 insertions(+)
 
 diff --git a/tpool/aio_linux.cc b/tpool/aio_linux.cc
-index d9aa8be2..d8a87a8f 100644
+index 4abc213..da75411 100644
 --- a/tpool/aio_linux.cc
 +++ b/tpool/aio_linux.cc
-@@ -59,6 +59,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
+@@ -58,6 +58,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
  */
  static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev)
  {
@@ -28,7 +28,7 @@ index d9aa8be2..d8a87a8f 100644
    int saved_errno= errno;
    int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx),
                     min_nr, nr, ev, 0);
-@@ -68,6 +69,9 @@ static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev)
+@@ -67,6 +68,9 @@ static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev)
      errno= saved_errno;
    }
    return ret;
@@ -36,8 +36,8 @@ index d9aa8be2..d8a87a8f 100644
 +  return -ENOSYS;
 +#endif
  }
- #endif
+
 
 --
-2.31.1
+2.29.2
 
meta-oe/recipes-dbs/mysql/mariadb/0001-disable-ucontext-on-musl.patch deleted +0 -26
deleted file mode 100644
index daf2432a54..0000000000
@@ -1,26 +0,0 @@
-From b658bdb38b7ff6a78915fd0ac390fc224e4006cb Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sun, 26 Mar 2017 14:30:33 -0700
-Subject: [PATCH] disable ucontext on musl
-
-musl does not have *contex() APIs even though it has ucontext.h header
-
-Signed-off-by: Khem Raj <[email protected]>
-
----
- include/my_context.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/my_context.h b/include/my_context.h
-index ea0e3496..4c9b37dc 100644
---- a/include/my_context.h
-+++ b/include/my_context.h
-@@ -31,7 +31,7 @@
- #define MY_CONTEXT_USE_X86_64_GCC_ASM
- #elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__)
- #define MY_CONTEXT_USE_I386_GCC_ASM
--#elif defined(HAVE_UCONTEXT_H)
-+#elif defined(__GLIBC__) && defined(HAVE_UCONTEXT_H)
- #define MY_CONTEXT_USE_UCONTEXT
- #else
- #define MY_CONTEXT_DISABLE
meta-oe/recipes-dbs/mysql/mariadb/clang_version_header_conflict.patch deleted +0 -32
deleted file mode 100644
index c77a869441..0000000000
@@ -1,32 +0,0 @@
-libc++ also has a file called version and this file and how cflags are specified
-it ends up including this file and resulting in compile errors
-
-fixes errors like
-storage/mroonga/version:1:1: error: expected unqualified-id
-7.07
-^
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <[email protected]>
-
---- a/storage/mroonga/CMakeLists.txt
-+++ b/storage/mroonga/CMakeLists.txt
-@@ -80,7 +80,7 @@ else()
-   set(MRN_SOURCE_DIR ${CMAKE_SOURCE_DIR})
- endif()
-
--file(READ ${MRN_SOURCE_DIR}/version        MRN_VERSION)
-+file(READ ${MRN_SOURCE_DIR}/ver            MRN_VERSION)
- file(READ ${MRN_SOURCE_DIR}/version_major  MRN_VERSION_MAJOR)
- file(READ ${MRN_SOURCE_DIR}/version_minor  MRN_VERSION_MINOR)
- file(READ ${MRN_SOURCE_DIR}/version_micro  MRN_VERSION_MICRO)
---- /dev/null
-+++ b/storage/mroonga/ver
-@@ -0,0 +1 @@
-+7.07
-\ No newline at end of file
---- a/storage/mroonga/version
-+++ /dev/null
-@@ -1 +0,0 @@
--7.07
-\ No newline at end of file
meta-oe/recipes-dbs/mysql/mariadb/ppc-remove-glibc-dep.patch +5 -14
index d6e53c29e1..a4deee6070 100644
@@ -3,11 +3,13 @@ Remove glibc specific function dependencies
 Sourced from: https://git.alpinelinux.org/aports/tree/main/mariadb/ppc-remove-glibc-dep.patch
 Signed-off-by: Khem Raj <[email protected]>
 
+diff --git a/include/my_cpu.h b/include/my_cpu.h
+index f2e26fca..94599b74 100644
 --- a/include/my_cpu.h
 +++ b/include/my_cpu.h
 @@ -24,17 +24,16 @@
  */
-
+
  #ifdef _ARCH_PWR8
 -#include <sys/platform/ppc.h>
  /* Very low priority */
@@ -28,7 +30,7 @@ Signed-off-by: Khem Raj <[email protected]>
  /* High priority */
  #define HMT_high() asm volatile("or 3,3,3")
  #else
-@@ -81,7 +80,7 @@ static inline void MY_RELAX_CPU(void)
+@@ -72,7 +71,7 @@ static inline void MY_RELAX_CPU(void)
    __asm__ __volatile__ ("pause");
  #endif
  #elif defined(_ARCH_PWR8)
@@ -36,15 +38,4 @@ Signed-off-by: Khem Raj <[email protected]>
 +  __builtin_ppc_get_timebase();
  #elif defined __GNUC__ && (defined __arm__ || defined __aarch64__)
    /* Mainly, prevent the compiler from optimizing away delay loops */
- #ifdef _aarch64_
---- a/storage/tokudb/PerconaFT/portability/toku_time.h
-+++ b/storage/tokudb/PerconaFT/portability/toku_time.h
-@@ -124,7 +124,7 @@ static inline tokutime_t toku_time_now(v
-     __asm __volatile__ ("mrs %[rt], cntvct_el0" : [rt] "=r" (result));
-     return result;
- #elif defined(__powerpc__)
--    return __ppc_get_timebase();
-+    return __builtin_ppc_get_timebase();
- #else
- #error No timer implementation for this platform
- #endif
+   __asm__ __volatile__ ("":::"memory");
meta-oe/recipes-dbs/mysql/mariadb/sys_futex.patch +14 -13
index 3277a3eee1..3244ab8da2 100644
@@ -1,22 +1,23 @@
- Use SYS_futex for syscall
+Use SYS_futex for syscall
 
 glibc defines SYS_futex and on newer 32bit CPUs like RISCV-32, arc there
 is no 32bit time_t therefore define SYS_futex in terms of SYS_futex_time64
 
 Upstream-Status: Pending
 Signed-off-by: Khem Raj <[email protected]>
---- a/storage/innobase/include/ib0mutex.h
-+++ b/storage/innobase/include/ib0mutex.h
-@@ -150,6 +150,12 @@ private:
- #include <linux/futex.h>
- #include <sys/syscall.h>
-
+
+--- a/storage/innobase/sync/srw_lock.cc
++++ b/storage/innobase/sync/srw_lock.cc
+@@ -210,6 +210,12 @@ void ssux_lock_low::wake() { WakeByAddre
+ #  ifdef __linux__
+ #   include <linux/futex.h>
+ #   include <sys/syscall.h>
 +/** Newer 32bit CPUs eg. RISCV-32 are defaulting to 64bit time_t from get go and
 + therefore do not define __NR_futex */
-+#if !defined(SYS_futex) && defined(SYS_futex_time64)
-+# define SYS_futex SYS_futex_time64
-+#endif
++#   if !defined(SYS_futex) && defined(SYS_futex_time64)
++#    define SYS_futex SYS_futex_time64
++#   endif
 +
- /** Mutex implementation that used the Linux futex. */
- template <template <typename> class Policy>
- struct TTASFutexMutex {
+ #   define SRW_FUTEX(a,op,n) \
+     syscall(SYS_futex, a, FUTEX_ ## op ## _PRIVATE, n, nullptr, nullptr, 0)
+ #  elif defined __OpenBSD__
meta-oe/recipes-dbs/mysql/mariadb_10.6.4.bb renamed from meta-oe/recipes-dbs/mysql/mariadb_10.5.11.bb +0 -0
similarity index 100%
rename from meta-oe/recipes-dbs/mysql/mariadb_10.5.11.bb
rename to meta-oe/recipes-dbs/mysql/mariadb_10.6.4.bb

--
2.33.0