ba8cd58b08
This is no longer required since the functions automatically get
pulled in based on the usage. A quick summary of footprint
comparisions before and after these set of patches is shown below:
Hello-World: (simplified for readability)
old Total image size:~ 104902 bytes (.bin may be padded larger)
old Total image size:~ 105254 bytes (.bin may be padded larger)
Per-archive contributions to ELF file:
Archive File DRAM .data & .bss IRAM Flash code & rodata Total
old libesp32.a 1973 177 4445 3939 2267 12801
new libesp32.a 1973 185 4473 3939 2267 12837
new libnvs_flash.a 0 92 0 274 8 374
new libstdc++.a 0 0 0 24 0 24
For some reason, nvs_flash.a (~400bytes) gets pulled in (particularly
the nvs_flash_init() function).
Power-Save: (simplified for readability)
old Total image size:~ 421347 bytes (.bin may be padded larger)
old Total image size:~ 421235 bytes (.bin may be padded larger)
old libtcpip_adapter.a 0 81 0 1947 115 2143
new libtcpip_adapter.a 0 69 0 1897 115 2081
The size actually shrinks a bit, since the AP interface function
doesn't get pulled in.
51 lines
1.6 KiB
Makefile
51 lines
1.6 KiB
Makefile
#
|
|
# Component Makefile
|
|
#
|
|
|
|
#ifdef IS_BOOTLOADER_BUILD
|
|
CFLAGS += -DBOOTLOADER_BUILD
|
|
#endif
|
|
|
|
COMPONENT_SRCDIRS := . hwcrypto
|
|
LIBS := core rtc net80211 pp wpa smartconfig coexist wps wpa2 phy coexist
|
|
|
|
LINKER_SCRIPTS += esp32.common.ld esp32.rom.ld esp32.peripherals.ld
|
|
|
|
ifeq ("$(CONFIG_NEWLIB_NANO_FORMAT)","y")
|
|
LINKER_SCRIPTS += esp32.rom.nanofmt.ld
|
|
endif
|
|
|
|
ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
|
|
LINKER_SCRIPTS += esp32.rom.spiflash.ld
|
|
endif
|
|
|
|
#ld_include_panic_highint_hdl is added as an undefined symbol because otherwise the
|
|
#linker will ignore panic_highint_hdl.S as it has no other files depending on any
|
|
#symbols in it.
|
|
COMPONENT_ADD_LDFLAGS += $(COMPONENT_PATH)/libhal.a \
|
|
-L$(COMPONENT_PATH)/lib \
|
|
$(addprefix -l,$(LIBS)) \
|
|
-L $(COMPONENT_PATH)/ld \
|
|
-T esp32_out.ld \
|
|
-u ld_include_panic_highint_hdl \
|
|
$(addprefix -T ,$(LINKER_SCRIPTS))
|
|
|
|
ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
|
|
|
|
COMPONENT_SUBMODULES += lib
|
|
|
|
# final linking of project ELF depends on all binary libraries, and
|
|
# all linker scripts (except esp32_out.ld, as this is code generated here.)
|
|
COMPONENT_ADD_LINKER_DEPS := $(ALL_LIB_FILES) $(addprefix ld/,$(LINKER_SCRIPTS))
|
|
|
|
# Preprocess esp32.ld linker script into esp32_out.ld
|
|
#
|
|
# The library doesn't really depend on esp32_out.ld, but it
|
|
# saves us from having to add the target to a Makefile.projbuild
|
|
$(COMPONENT_LIBRARY): esp32_out.ld
|
|
|
|
esp32_out.ld: $(COMPONENT_PATH)/ld/esp32.ld ../include/sdkconfig.h
|
|
$(CC) -I ../include -C -P -x c -E $< -o $@
|
|
|
|
COMPONENT_EXTRA_CLEAN := esp32_out.ld
|