xiaoxiang781216 commented on a change in pull request #5375:
URL: https://github.com/apache/incubator-nuttx/pull/5375#discussion_r800090845
##########
File path: arch/arm/src/Makefile
##########
@@ -151,6 +151,11 @@ $(KBIN): $(OBJS)
board$(DELIM)libboard$(LIBEXT):
$(Q) $(MAKE) -C board libboard$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)"
+ifneq ($(SCRIPTOUT),)
+$(SCRIPTOUT): $(LDSCRIPT_TEMPLATE)
+ $(Q) $(CC) -isystem $(TOPDIR)/include -I
$(BOARD_COMMON_DIR)$(DELIM)scripts -C -P -x c -E $(LDSCRIPT_TEMPLATE) -o $@
Review comment:
can we call PREPROCESS instead
##########
File path: boards/risc-v/esp32c3/esp32c3-devkit/scripts/Make.defs
##########
@@ -23,7 +23,15 @@ include $(TOPDIR)/tools/Config.mk
include $(TOPDIR)/tools/esp32c3/Config.mk
include $(TOPDIR)/arch/risc-v/src/common/Toolchain.defs
+ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32c3.template.ld),)
+ LDSCRIPT_TEMPLATE = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32c3.template.ld
+else
+ LDSCRIPT_TEMPLATE =
$(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32c3.template.ld
+endif
+
LDSCRIPT1 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32c3_out.ld
+SCRIPTOUT = $(LDSCRIPT1)
Review comment:
How about we remove -T from ARCHSCRIPT:
```
ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32c3.template.ld),)
LDSCRIPT1 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32c3.template.ld
else
LDSCRIPT1 = $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32c3.template.ld
endif
ifeq ($(CONFIG_ESP32C3_APP_FORMAT_MCUBOOT),y)
LDSCRIPT2 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32c3_mcuboot.ld
else
LDSCRIPT2 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32c3.ld
endif
LDSCRIPT3 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32c3_rom.ld
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
ARCHSCRIPT = "${shell cygpath -w $(LDSCRIPT1)}"
ARCHSCRIPT += "${shell cygpath -w $(LDSCRIPT2)}"
ARCHSCRIPT += "${shell cygpath -w $(LDSCRIPT3)}"
else
ARCHSCRIPT = $(LDSCRIPT1) $(LDSCRIPT2) $(LDSCRIPT3)
endif
```
and always preprocess files contained in ARCHSCRIPT. Finally, add back -T
before append it to LDFLAGS.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]