Skip to contentSkip to conversation

mariadb: Fix build on newer 32bit architectures

PATCH New Khem Raj 1 participant 1 message Apr 3, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 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

---
 meta-oe/recipes-dbs/mysql/mariadb.inc         |  2 +
 ...ck-if-syscall-exists-before-using-it.patch | 43 +++++++++++++++++++
 .../recipes-dbs/mysql/mariadb/sys_futex.patch | 22 ++++++++++
 3 files changed, 67 insertions(+)
 create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/0001-aio_linux-Check-if-syscall-exists-before-using-it.patch
 create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/sys_futex.patch
meta-oe/recipes-dbs/mysql/mariadb.inc +2 -0
index 67cfa54f02..9833b28857 100644
@@ -20,6 +20,8 @@ SRC_URI = "https://downloads.mariadb.org/interstitial/${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_linux-Check-if-syscall-exists-before-using-it.patch \
+           file://sys_futex.patch \
           "
 SRC_URI_append_libc-musl = " file://ppc-remove-glibc-dep.patch"
 
meta-oe/recipes-dbs/mysql/mariadb/0001-aio_linux-Check-if-syscall-exists-before-using-it.patch new file +43 -0

43 lines not on this page · raw message

meta-oe/recipes-dbs/mysql/mariadb/sys_futex.patch new file +22 -0
new file mode 100644
index 0000000000..3277a3eee1
@@ -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 <[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>
+ 
++/** 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 {
Signature · 1 line
2.31.1