mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:16:47 +08:00
xtensa/esp32: Simplify board linker script selection
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
committed by
Xiang Xiao
parent
236ee5c80d
commit
f78c6432d8
@@ -1 +0,0 @@
|
||||
/esp32_out.ld
|
||||
@@ -23,42 +23,22 @@ include $(TOPDIR)/tools/Config.mk
|
||||
include $(TOPDIR)/tools/esp32/Config.mk
|
||||
include $(TOPDIR)/arch/xtensa/src/lx6/Toolchain.defs
|
||||
|
||||
# This is the generated memory layout linker script. It will always be
|
||||
# generated at the board level.
|
||||
|
||||
ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_out.ld
|
||||
ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32_rom.ld
|
||||
|
||||
# Pick the linker scripts from the board level if they exist, if not
|
||||
# pick the common linker scripts.
|
||||
|
||||
ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_sections.ld),)
|
||||
ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_sections.ld
|
||||
ifeq ($(CONFIG_BUILD_PROTECTED),y)
|
||||
ARCHSCRIPT += $(call FINDSCRIPT,protected_memory.ld)
|
||||
ARCHSCRIPT += $(call FINDSCRIPT,kernel-space.ld)
|
||||
else
|
||||
ifeq ($(CONFIG_BUILD_PROTECTED),y)
|
||||
ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)kernel-space.ld
|
||||
else
|
||||
ifeq ($(CONFIG_ESP32_APP_FORMAT_MCUBOOT),y)
|
||||
ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)mcuboot_sections.ld
|
||||
else
|
||||
ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)legacy_sections.ld
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ARCHSCRIPT += $(call FINDSCRIPT,flat_memory.ld)
|
||||
|
||||
ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_rom.ld),)
|
||||
ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_rom.ld
|
||||
else
|
||||
ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32_rom.ld
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_memory.ld),)
|
||||
LDSCRIPT_TEMPLATE = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_memory.ld
|
||||
else
|
||||
ifeq ($(CONFIG_BUILD_PROTECTED),y)
|
||||
LDSCRIPT_TEMPLATE = $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)protected_memory.ld
|
||||
else
|
||||
LDSCRIPT_TEMPLATE = $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)flat_memory.ld
|
||||
endif
|
||||
ifeq ($(CONFIG_ESP32_APP_FORMAT_MCUBOOT),y)
|
||||
ARCHSCRIPT += $(call FINDSCRIPT,mcuboot_sections.ld)
|
||||
else
|
||||
ARCHSCRIPT += $(call FINDSCRIPT,legacy_sections.ld)
|
||||
endif
|
||||
endif
|
||||
|
||||
ARCHPICFLAGS = -fpic
|
||||
|
||||
@@ -39,18 +39,6 @@ ifeq ($(CONFIG_ARCH_BUTTONS),y)
|
||||
CSRCS += esp32_buttons.c
|
||||
endif
|
||||
|
||||
SCRIPTOUT = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_out.ld
|
||||
|
||||
.PHONY = context distclean
|
||||
|
||||
$(SCRIPTOUT): $(LDSCRIPT_TEMPLATE) $(CONFIGFILE)
|
||||
$(Q) $(CC) -isystem $(TOPDIR)/include -C -P -x c -E $(LDSCRIPT_TEMPLATE) -o $@
|
||||
|
||||
context:: $(SCRIPTOUT)
|
||||
|
||||
distclean::
|
||||
$(call DELFILE, $(SCRIPTOUT))
|
||||
|
||||
DEPPATH += --dep-path board
|
||||
VPATH += :board
|
||||
CFLAGS += $(shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)
|
||||
|
||||
Reference in New Issue
Block a user