From 01e01c459739afb54d5db74f29c3ecf62bb696e5 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 7 Dec 2021 11:27:22 +0100 Subject: [PATCH] cpu/esp_common: move LINKFLAGS to Makefile.include --- cpu/esp_common/Makefile.dep | 7 ------- cpu/esp_common/Makefile.include | 12 ++++++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/cpu/esp_common/Makefile.dep b/cpu/esp_common/Makefile.dep index 4ac30362bd..4bb829937f 100644 --- a/cpu/esp_common/Makefile.dep +++ b/cpu/esp_common/Makefile.dep @@ -85,10 +85,3 @@ ifneq (,$(filter esp_wifi_any,$(USEMODULE))) USEMODULE += netopt USEMODULE += xtimer endif - -ifneq (,$(filter esp_idf_heap,$(USEMODULE))) - LINKFLAGS += -Wl,-wrap,_malloc_r - LINKFLAGS += -Wl,-wrap,_calloc_r - LINKFLAGS += -Wl,-wrap,_realloc_r - LINKFLAGS += -Wl,-wrap,_free_r -endif diff --git a/cpu/esp_common/Makefile.include b/cpu/esp_common/Makefile.include index 41757bdab6..7b7987525c 100644 --- a/cpu/esp_common/Makefile.include +++ b/cpu/esp_common/Makefile.include @@ -88,10 +88,14 @@ LINKFLAGS += -L$(ESP_SDK_DIR)/components/$(CPU)/lib endif 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_r +# use the wrapper functions for calloc to add correct overflow detection missing +# in the newlib's version. +LINKFLAGS += -Wl,-wrap,_calloc_r + +ifneq (,$(filter esp_idf_heap,$(USEMODULE))) + LINKFLAGS += -Wl,-wrap,_malloc_r + LINKFLAGS += -Wl,-wrap,_realloc_r + LINKFLAGS += -Wl,-wrap,_free_r endif # LINKFLAGS += -Wl,--verbose