From 359a14430fcd43aff75e24c986c508ead124307d Mon Sep 17 00:00:00 2001 From: "yuhuan.du" Date: Thu, 23 Feb 2023 17:45:51 +0800 Subject: [PATCH] [Add] Declaring the memalign function is not supported --- components/libc_stub/newlib_stub.c | 6 ++++++ hardware/chip/x2000/package.yaml | 1 + 2 files changed, 7 insertions(+) diff --git a/components/libc_stub/newlib_stub.c b/components/libc_stub/newlib_stub.c index 6df15aa0..046d2538 100644 --- a/components/libc_stub/newlib_stub.c +++ b/components/libc_stub/newlib_stub.c @@ -369,6 +369,12 @@ void *__wrap__malloc_r(struct _reent *ptr, size_t size) return mem; } +void *__wrap__memalign_r(struct _reent *ptr, size_t boundary, size_t size) +{ + printf("Error! Function \"memalign\" not supported !\n"); + return NULL; +} + void *__wrap__realloc_r(struct _reent *ptr, void *old, size_t newlen) { void *mem; diff --git a/hardware/chip/x2000/package.yaml b/hardware/chip/x2000/package.yaml index 2500639e..a6c64f73 100644 --- a/hardware/chip/x2000/package.yaml +++ b/hardware/chip/x2000/package.yaml @@ -96,6 +96,7 @@ build_config: -Wl,--wrap=localtime_r -Wl,--wrap=localtime -Wl,--wrap=_malloc_r + -Wl,--wrap=_memalign_r -Wl,--wrap=_realloc_r -Wl,--wrap=_calloc_r -Wl,--wrap=_free_r -- Gitee