Skip to content

Commit 9aec3df

Browse files
committed
emlearn_iir_q15: Try avoid duplicate symbol on RISC-V
1 parent 34a9c6b commit 9aec3df

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/emlearn_iir_q15/iir_filter.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55

66
#include <string.h>
77

8-
// memset is used by some standard C constructs
9-
#if !defined(__linux__)
10-
__attribute__((weak)) void *memcpy(void *dst, const void *src, size_t n) {
8+
// memset is used by some standard C constructs. Missing on some platforms, but not all...
9+
// Unfortunately cannot use weak symbols with mpy_ld
10+
#if !defined(__linux__) && !defined(__riscv__)
11+
void *memcpy(void *dst, const void *src, size_t n) {
1112
return mp_fun_table.memmove_(dst, src, n);
1213
}
13-
__attribute__((weak)) void *memset(void *s, int c, size_t n) {
14+
void *memset(void *s, int c, size_t n) {
1415
return mp_fun_table.memset_(s, c, n);
1516
}
1617
#endif

0 commit comments

Comments
 (0)