cpu/esp_common: fix bootloop on ESP8266
(cherry picked from commit 6c4f0da7a76d874054493bf30980fb331d330497)
This commit is contained in:
parent
efd80adc84
commit
a20bd7cba6
@ -88,7 +88,7 @@ LINKFLAGS += -nostdlib -Wl,-gc-sections -Wl,-static
|
||||
ifeq (,$(filter esp_idf_heap,$(USEMODULE)))
|
||||
# use the wrapper functions for calloc to add correct overflow detection missing
|
||||
# in the newlib's version.
|
||||
LINKFLAGS += -Wl,-wrap=calloc
|
||||
LINKFLAGS += -Wl,-wrap=_calloc_r
|
||||
endif
|
||||
|
||||
# LINKFLAGS += -Wl,--verbose
|
||||
|
||||
@ -289,7 +289,7 @@ void* IRAM_ATTR __wrap__calloc_r(struct _reent *r, size_t count, size_t size)
|
||||
|
||||
#else /* MODULE_ESP_IDF_HEAP */
|
||||
|
||||
void *__wrap_calloc(size_t nmemb, size_t size)
|
||||
void* IRAM_ATTR __wrap__calloc_r(struct _reent *r, size_t nmemb, size_t size)
|
||||
{
|
||||
/* The xtensa support has not yet upstreamed to newlib. Hence, the fixed
|
||||
* calloc implementation of newlib >= 4.0.0 is not available to the ESP
|
||||
@ -299,7 +299,7 @@ void *__wrap_calloc(size_t nmemb, size_t size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *res = malloc(total_size);
|
||||
void *res = _malloc_r(r, total_size);
|
||||
|
||||
if (res) {
|
||||
memset(res, 0, total_size);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user