Initial RAM optimization for ESP8266

by putting big constants into ROM, instead of residing in RAM.
Related to https://github.com/Samsung/jerryscript/issues/1224.

JerryScript-DCO-1.0-Signed-off-by: Slavey Karadzhov slaff@attachix.com
This commit is contained in:
Slavey Karadzhov
2016-08-01 18:06:52 +02:00
parent d1b0b58729
commit ce8abfb636
7 changed files with 74 additions and 8 deletions
+12
View File
@@ -30,9 +30,21 @@ ESPTOOL ?= /opt/Espressif/esptool-py/esptool.py
# compile flags
ESP_CFLAGS := -D__TARGET_ESP8266 -D__attr_always_inline___=
MFORCE32 = `xtensa-lx106-elf-gcc --help=target | grep mforce-l32`
ifneq ($(MFORCE32),)
# Your compiler supports the -mforce-l32 flag which means that
# constants can be placed in ROM to free additional RAM
ESP_CFLAGS += -DJERRY_CONST_DATA="__attribute__((aligned(4))) __attribute__((section(\".irom.text\")))"
endif
ESP_CFLAGS += -Wl,-EL -fno-inline-functions
ESP_CFLAGS += -ffunction-sections -fdata-sections
ESP_CFLAGS += -mlongcalls -mtext-section-literals -mno-serialize-volatile
ifneq ($(MFORCE32),)
ESP_CFLAGS += -mforce-l32
endif
# include path
ESP_LIBS_INC :=$(CURDIR)/targets/esp8266/include