summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-dbs/mysql/mariadb/3871.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-dbs/mysql/mariadb/3871.patch')
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb/3871.patch29
1 files changed, 29 insertions, 0 deletions
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 @@
1From d6923ac0adc11a0364acd421316116190eedb508 Mon Sep 17 00:00:00 2001
2From: Brad Smith <brad@comstyle.com>
3Date: Fri, 7 Mar 2025 02:04:01 -0500
4Subject: [PATCH] Fix building with Clang and GCC on RISC-V
5
6Clang does not have the builtin __builtin_riscv_pause().
7
8Upstream-Status: Backport [https://github.com/MariaDB/server/pull/3871]
9Signed-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");