cpu/esp_common: move LINKFLAGS to Makefile.include

This commit is contained in:
Leandro Lanzieri 2021-12-07 11:27:22 +01:00
parent b761701ca3
commit 01e01c4597
No known key found for this signature in database
GPG Key ID: F4E9A721761C7593
2 changed files with 8 additions and 11 deletions

View File

@ -85,10 +85,3 @@ ifneq (,$(filter esp_wifi_any,$(USEMODULE)))
USEMODULE += netopt USEMODULE += netopt
USEMODULE += xtimer USEMODULE += xtimer
endif 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

View File

@ -88,10 +88,14 @@ LINKFLAGS += -L$(ESP_SDK_DIR)/components/$(CPU)/lib
endif endif
LINKFLAGS += -nostdlib -Wl,-gc-sections -Wl,-static 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 # use the wrapper functions for calloc to add correct overflow detection missing
# in the newlib's version. # in the newlib's version.
LINKFLAGS += -Wl,-wrap=_calloc_r 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 endif
# LINKFLAGS += -Wl,--verbose # LINKFLAGS += -Wl,--verbose