diff options
author | Khem Raj <raj.khem@gmail.com> | 2025-04-07 17:49:43 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-04-07 17:50:06 -0700 |
commit | f66fc1d2e5a1e7fd5ea2a433a7f7126775ba5adf (patch) | |
tree | 9a572d88a765989af27b5f2fc8e8e36ddfb5ec14 | |
parent | 09f110b8a0f2a134582315a63a073fb841cbc2f9 (diff) | |
download | meta-openembedded-f66fc1d2e5a1e7fd5ea2a433a7f7126775ba5adf.tar.gz |
mariadb: Fix build on riscv32
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mariadb.inc | 1 | ||||
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mariadb/riscv32.patch | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc index eedb6735a4..3a39d036f7 100644 --- a/meta-oe/recipes-dbs/mysql/mariadb.inc +++ b/meta-oe/recipes-dbs/mysql/mariadb.inc | |||
@@ -25,6 +25,7 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \ | |||
25 | file://0001-Add-missing-includes-cstdint-and-cstdio.patch \ | 25 | file://0001-Add-missing-includes-cstdint-and-cstdio.patch \ |
26 | file://0001-Ensure-compatibility-with-ARMv9-by-updating-.arch-di.patch \ | 26 | file://0001-Ensure-compatibility-with-ARMv9-by-updating-.arch-di.patch \ |
27 | file://3871.patch \ | 27 | file://3871.patch \ |
28 | file://riscv32.patch \ | ||
28 | " | 29 | " |
29 | SRC_URI[sha256sum] = "ff6595f8c482f9921e39b97fa1122377a69f0dcbd92553c6b9032cbf0e9b5354" | 30 | SRC_URI[sha256sum] = "ff6595f8c482f9921e39b97fa1122377a69f0dcbd92553c6b9032cbf0e9b5354" |
30 | 31 | ||
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/riscv32.patch b/meta-oe/recipes-dbs/mysql/mariadb/riscv32.patch new file mode 100644 index 0000000000..24b86584e3 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/riscv32.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | Do not use static_cast in C sources | ||
2 | |||
3 | C compiler does not recognise static_cast which is a C++ keyword | ||
4 | and bails out compiling mysys/my_rdtsc.c, use traditional typecast | ||
5 | instead | ||
6 | |||
7 | Upstream-Status: Submitted [https://github.com/MariaDB/server/pull/1981/files#r2032207090] | ||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- a/include/my_rdtsc.h | ||
10 | +++ b/include/my_rdtsc.h | ||
11 | @@ -226,7 +226,7 @@ static inline ulonglong my_timer_cycles( | ||
12 | "sub %0, zero, %0\n" | ||
13 | "and %1, %1, %0\n" | ||
14 | : "=r"(result_hi0), "=r"(result_lo), "=r"(result_hi1)); | ||
15 | - return (static_cast<ulonglong>(result_hi1) << 32) | result_lo; | ||
16 | + return ((ulonglong)result_hi1 << 32) | result_lo; | ||
17 | # else | ||
18 | ulonglong result; | ||
19 | __asm __volatile__("rdtime %0" : "=r"(result)); | ||