diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-04-03 12:40:14 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-04-06 09:02:12 -0700 |
commit | bd8e72c1397f700fca0ddc44120abf9d325fd872 (patch) | |
tree | e3b63f13681c05b639abe945a1366e50ca0fbc33 /meta-oe/recipes-dbs/mysql/mariadb | |
parent | 7e64cce442c14f026a5e43cd5d90416c9f81343a (diff) | |
download | meta-openembedded-bd8e72c1397f700fca0ddc44120abf9d325fd872.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>
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 000000000..a2f7812c5 --- /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 000000000..3277a3eee --- /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 { | ||