diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-04-03 12:40:14 -0700 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2021-04-07 09:37:36 -0700 |
commit | 7580c96d6ae244262c6c74395b1a656f1dc50a36 (patch) | |
tree | 484398d6e79d862eaa0973ab6ee0ce8b0c35eb13 /meta-oe/recipes-dbs/mysql/mariadb | |
parent | b4c4086e69b6567dab5b01f2c299f0d491a8fdde (diff) | |
download | meta-openembedded-contrib-7580c96d6ae244262c6c74395b1a656f1dc50a36.tar.gz |
mariadb: Fix build on newer 32bit architectures
newer 32bit arches e.g. RV32 and ARC do not have __NR_io_getevents
syscall and have started of with 64bit time_t so there is no 32bit
version
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit bd8e72c1397f700fca0ddc44120abf9d325fd872)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-dbs/mysql/mariadb')
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mariadb/0001-aio_linux-Check-if-syscall-exists-before-using-it.patch | 43 | ||||
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mariadb/sys_futex.patch | 22 |
2 files changed, 65 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/0001-aio_linux-Check-if-syscall-exists-before-using-it.patch b/meta-oe/recipes-dbs/mysql/mariadb/0001-aio_linux-Check-if-syscall-exists-before-using-it.patch new file mode 100644 index 0000000000..a2f7812c50 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/0001-aio_linux-Check-if-syscall-exists-before-using-it.patch @@ -0,0 +1,43 @@ +From 5d9a869a72420cf0bb08b6aa93e980df90bdcf2e Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 3 Apr 2021 12:02:36 -0700 +Subject: [PATCH] aio_linux: Check if syscall exists before using it + +Return -ENOSYS if not implememented, fixes build on arches like RISCV32 +Fixes +tpool/aio_linux.cc:63:20: error: '__NR_io_getevents' was not declared in this scope; did you mean 'io_getevents'? + 63 | int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx), + | ^~~~~~~~~~~~~~~~~ + | io_getevents + +Upstream-Staus: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + tpool/aio_linux.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tpool/aio_linux.cc b/tpool/aio_linux.cc +index d9aa8be2..d8a87a8f 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*/ + */ + static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev) + { ++#ifdef __NR_io_getevents + 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) + errno= saved_errno; + } + return ret; ++#else ++ return -ENOSYS; ++#endif + } + #endif + +-- +2.31.1 + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/sys_futex.patch b/meta-oe/recipes-dbs/mysql/mariadb/sys_futex.patch new file mode 100644 index 0000000000..3277a3eee1 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/sys_futex.patch @@ -0,0 +1,22 @@ + 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 <raj.khem@gmail.com> +--- 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> + ++/** 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 ++ + /** Mutex implementation that used the Linux futex. */ + template <template <typename> class Policy> + struct TTASFutexMutex { |