diff options
3 files changed, 67 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc index 67cfa54f02..9833b28857 100644 --- a/meta-oe/recipes-dbs/mysql/mariadb.inc +++ b/meta-oe/recipes-dbs/mysql/mariadb.inc | |||
| @@ -20,6 +20,8 @@ SRC_URI = "https://downloads.mariadb.org/interstitial/${BP}/source/${BP}.tar.gz | |||
| 20 | file://fix-arm-atomic.patch \ | 20 | file://fix-arm-atomic.patch \ |
| 21 | file://0001-Fix-library-LZ4-lookup.patch \ | 21 | file://0001-Fix-library-LZ4-lookup.patch \ |
| 22 | file://0001-innobase-Define-__NR_futex-if-it-does-not-exist.patch \ | 22 | file://0001-innobase-Define-__NR_futex-if-it-does-not-exist.patch \ |
| 23 | file://0001-aio_linux-Check-if-syscall-exists-before-using-it.patch \ | ||
| 24 | file://sys_futex.patch \ | ||
| 23 | " | 25 | " |
| 24 | SRC_URI_append_libc-musl = " file://ppc-remove-glibc-dep.patch" | 26 | SRC_URI_append_libc-musl = " file://ppc-remove-glibc-dep.patch" |
| 25 | 27 | ||
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 @@ | |||
| 1 | From 5d9a869a72420cf0bb08b6aa93e980df90bdcf2e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sat, 3 Apr 2021 12:02:36 -0700 | ||
| 4 | Subject: [PATCH] aio_linux: Check if syscall exists before using it | ||
| 5 | |||
| 6 | Return -ENOSYS if not implememented, fixes build on arches like RISCV32 | ||
| 7 | Fixes | ||
| 8 | tpool/aio_linux.cc:63:20: error: '__NR_io_getevents' was not declared in this scope; did you mean 'io_getevents'? | ||
| 9 | 63 | int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx), | ||
| 10 | | ^~~~~~~~~~~~~~~~~ | ||
| 11 | | io_getevents | ||
| 12 | |||
| 13 | Upstream-Staus: Pending | ||
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 15 | --- | ||
| 16 | tpool/aio_linux.cc | 4 ++++ | ||
| 17 | 1 file changed, 4 insertions(+) | ||
| 18 | |||
| 19 | diff --git a/tpool/aio_linux.cc b/tpool/aio_linux.cc | ||
| 20 | index d9aa8be2..d8a87a8f 100644 | ||
| 21 | --- a/tpool/aio_linux.cc | ||
| 22 | +++ b/tpool/aio_linux.cc | ||
| 23 | @@ -59,6 +59,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/ | ||
| 24 | */ | ||
| 25 | static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev) | ||
| 26 | { | ||
| 27 | +#ifdef __NR_io_getevents | ||
| 28 | int saved_errno= errno; | ||
| 29 | int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx), | ||
| 30 | min_nr, nr, ev, 0); | ||
| 31 | @@ -68,6 +69,9 @@ static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev) | ||
| 32 | errno= saved_errno; | ||
| 33 | } | ||
| 34 | return ret; | ||
| 35 | +#else | ||
| 36 | + return -ENOSYS; | ||
| 37 | +#endif | ||
| 38 | } | ||
| 39 | #endif | ||
| 40 | |||
| 41 | -- | ||
| 42 | 2.31.1 | ||
| 43 | |||
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 @@ | |||
| 1 | Use SYS_futex for syscall | ||
| 2 | |||
| 3 | glibc defines SYS_futex and on newer 32bit CPUs like RISCV-32, arc there | ||
| 4 | is no 32bit time_t therefore define SYS_futex in terms of SYS_futex_time64 | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 8 | --- a/storage/innobase/include/ib0mutex.h | ||
| 9 | +++ b/storage/innobase/include/ib0mutex.h | ||
| 10 | @@ -150,6 +150,12 @@ private: | ||
| 11 | #include <linux/futex.h> | ||
| 12 | #include <sys/syscall.h> | ||
| 13 | |||
| 14 | +/** Newer 32bit CPUs eg. RISCV-32 are defaulting to 64bit time_t from get go and | ||
| 15 | + therefore do not define __NR_futex */ | ||
| 16 | +#if !defined(SYS_futex) && defined(SYS_futex_time64) | ||
| 17 | +# define SYS_futex SYS_futex_time64 | ||
| 18 | +#endif | ||
| 19 | + | ||
| 20 | /** Mutex implementation that used the Linux futex. */ | ||
| 21 | template <template <typename> class Policy> | ||
| 22 | struct TTASFutexMutex { | ||
