Skip to content

Commit 438b81b

Browse files
authored
Fix missing symbols when using aot mode on riscv platforms (#3812)
Add symbol __atomic_compare_exchange_4 and __atomic_store_4.
1 parent 5ce6f90 commit 438b81b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

core/iwasm/aot/arch/aot_reloc_riscv.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#undef NEED_SOFT_I32_DIV
2525
#undef NEED_SOFT_I64_MUL
2626
#undef NEED_SOFT_I64_DIV
27+
#undef NEED_SOFT_ATOMIC
2728

2829
#ifdef __riscv_flen
2930
#if __riscv_flen == 32
@@ -48,6 +49,10 @@
4849
#define NEED_SOFT_I64_DIV
4950
#endif
5051

52+
#ifndef __riscv_atomic
53+
#define NEED_SOFT_ATOMIC
54+
#endif
55+
5156
/* clang-format off */
5257
void __adddf3(void);
5358
void __addsf3(void);
@@ -101,6 +106,9 @@ void __umoddi3(void);
101106
void __umodsi3(void);
102107
void __unorddf2(void);
103108
void __unordsf2(void);
109+
bool __atomic_compare_exchange_4(volatile void *, void *, unsigned int,
110+
bool, int, int);
111+
void __atomic_store_4(volatile void *, unsigned int, int);
104112
/* clang-format on */
105113

106114
static SymbolMap target_sym_map[] = {
@@ -127,6 +135,7 @@ static SymbolMap target_sym_map[] = {
127135
* to convert float and long long
128136
*/
129137
REG_SYM(__floatundisf),
138+
REG_SYM(__floatdisf),
130139
#endif
131140
#ifdef NEED_SOFT_DP
132141
REG_SYM(__adddf3),
@@ -175,6 +184,10 @@ static SymbolMap target_sym_map[] = {
175184
REG_SYM(__moddi3),
176185
REG_SYM(__udivdi3),
177186
REG_SYM(__umoddi3),
187+
#endif
188+
#ifdef NEED_SOFT_ATOMIC
189+
REG_SYM(__atomic_compare_exchange_4),
190+
REG_SYM(__atomic_store_4),
178191
#endif
179192
/* clang-format on */
180193
};

0 commit comments

Comments
 (0)