@@ -15,6 +15,7 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
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_libaio-Check-if-syscall-exists-before-using-it.patch \
file://ssize_t.patch \
file://sys_futex.patch \
file://cross-compiling.patch \
new file mode 100644
@@ -0,0 +1,49 @@
+From a30e52fdb6507dd39b081b1218d95eb8582b81fb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
+ <zboszor@gmail.com>
+Date: Mon, 13 Oct 2025 08:57:05 +0200
+Subject: [PATCH] aio_libaio: Check if syscall exists before using it
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Return -ENOSYS if not implememented, fixes build on arches like RISCV32
+Fixes
+tpool/aio_libaio.cc:61:20:
+error: use of undeclared identifier '
+ ↪ __NR_io_getevents'; did you mean 'io_getevents'?
+ | 61 | int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx),
+ | | ^~~~~~~~~~~~~~~~~
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
+---
+ tpool/aio_libaio.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tpool/aio_libaio.cc b/tpool/aio_libaio.cc
+index 2ce69384cde..60f558afa87 100644
+--- a/tpool/aio_libaio.cc
++++ b/tpool/aio_libaio.cc
+@@ -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)
+ noexcept
+ {
++#ifdef __NR_io_getevents
+ int saved_errno= errno;
+ int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx),
+ min_nr, nr, ev, 0);
+@@ -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;
++#else
++ return -ENOSYS;
++#endif
+ }
+
+
+--
+2.51.0
+
The libaio subsystem in MariaDB was rewritten in 11.4.8, which made the previously used patch called 0001-aio_linux-Check-if-syscall-exists-before-using-it.patch non-applicable. This patch was deleted in commit f3cd830c09 ("mariadb: 11.4.8") but it's still needed, because the original code was simply moved into a new source file. Add a new patch applying the same change to tpool/aio_libaio.cc to fix the build error on riscv32. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> --- meta-oe/recipes-dbs/mysql/mariadb.inc | 1 + ...ck-if-syscall-exists-before-using-it.patch | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/0001-aio_libaio-Check-if-syscall-exists-before-using-it.patch