diff options
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mariadb.inc | 1 | ||||
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mariadb/3871.patch | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc index f704ff6dec..eedb6735a4 100644 --- a/meta-oe/recipes-dbs/mysql/mariadb.inc +++ b/meta-oe/recipes-dbs/mysql/mariadb.inc | |||
@@ -24,6 +24,7 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \ | |||
24 | file://lfs64.patch \ | 24 | file://lfs64.patch \ |
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 | " | 28 | " |
28 | SRC_URI[sha256sum] = "ff6595f8c482f9921e39b97fa1122377a69f0dcbd92553c6b9032cbf0e9b5354" | 29 | SRC_URI[sha256sum] = "ff6595f8c482f9921e39b97fa1122377a69f0dcbd92553c6b9032cbf0e9b5354" |
29 | 30 | ||
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/3871.patch b/meta-oe/recipes-dbs/mysql/mariadb/3871.patch new file mode 100644 index 0000000000..4bbca2d706 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/3871.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From d6923ac0adc11a0364acd421316116190eedb508 Mon Sep 17 00:00:00 2001 | ||
2 | From: Brad Smith <brad@comstyle.com> | ||
3 | Date: Fri, 7 Mar 2025 02:04:01 -0500 | ||
4 | Subject: [PATCH] Fix building with Clang and GCC on RISC-V | ||
5 | |||
6 | Clang does not have the builtin __builtin_riscv_pause(). | ||
7 | |||
8 | Upstream-Status: Backport [https://github.com/MariaDB/server/pull/3871] | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | include/my_cpu.h | 7 ++++++- | ||
12 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
13 | |||
14 | --- a/include/my_cpu.h | ||
15 | +++ b/include/my_cpu.h | ||
16 | @@ -97,7 +97,12 @@ static inline void MY_RELAX_CPU(void) | ||
17 | /* Changed from __ppc_get_timebase for musl and clang compatibility */ | ||
18 | __builtin_ppc_get_timebase(); | ||
19 | #elif defined __GNUC__ && defined __riscv | ||
20 | - __builtin_riscv_pause(); | ||
21 | + /* The GCC-only __builtin_riscv_pause() or the pause instruction is | ||
22 | + encoded like a fence instruction with special parameters. On RISC-V | ||
23 | + implementations that do not support arch=+zihintpause this | ||
24 | + instruction could be interpreted as a more expensive memory fence; | ||
25 | + it should not be an illegal instruction. */ | ||
26 | + __asm__ volatile(".long 0x0100000f" ::: "memory"); | ||
27 | #elif defined __GNUC__ | ||
28 | /* Mainly, prevent the compiler from optimizing away delay loops */ | ||
29 | __asm__ __volatile__ ("":::"memory"); | ||