You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/11/01 17:40:27 UTC

[GitHub] [incubator-nuttx] gustavonihei opened a new pull request, #7500: xtensa/esp32s3: Move linker scripts to folder common to all boards

gustavonihei opened a new pull request, #7500:
URL: https://github.com/apache/incubator-nuttx/pull/7500

   ## Summary
   
   This PR intends to reduce the repetition of Linker-related files among boards based on **ESP32-S3** by moving the generic ones to a common folder.
   
   ## Impact
   
   No relevant impact expected to neither existing boards on the repository, nor to custom boards.
   Custom boards, in fact, may benefit from this change and avoid the aforementioned duplication of linker script files.
   
   ## Testing
   
   CI build pass.
   `esp32s3-devkit:nsh` booting fine.
   
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7500: xtensa/esp32s3: Move linker scripts to folder common to all boards

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7500:
URL: https://github.com/apache/incubator-nuttx/pull/7500#discussion_r1010805492


##########
boards/xtensa/esp32s3/esp32s3-devkit/src/Make.defs:
##########
@@ -49,13 +49,12 @@ ifeq ($(CONFIG_LCD_ST7735),y)
 CSRCS += esp32s3_st7735.c
 endif
 
-SCRIPTIN = $(SCRIPTDIR)$(DELIM)esp32s3.template.ld
 SCRIPTOUT = $(SCRIPTDIR)$(DELIM)esp32s3_out.ld
 
 .PHONY = context distclean
 
-$(SCRIPTOUT): $(SCRIPTIN) $(CONFIGFILE)
-	$(Q) $(CC) -isystem $(TOPDIR)/include -C -P -x c -E $(SCRIPTIN) -o $@
+$(SCRIPTOUT): $(LDSCRIPT_TEMPLATE) $(CONFIGFILE)
+	$(Q) $(CC) -isystem $(TOPDIR)/include -I $(BOARD_COMMON_DIR)$(DELIM)scripts -C -P -x c -E $(LDSCRIPT_TEMPLATE) -o $@

Review Comment:
   don't need call $(CC) now, since arch/Makefile will do the same thing after https://github.com/apache/incubator-nuttx/pull/7208



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] gustavonihei commented on a diff in pull request #7500: xtensa/esp32s3: Move linker scripts to folder common to all boards

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on code in PR #7500:
URL: https://github.com/apache/incubator-nuttx/pull/7500#discussion_r1011705029


##########
boards/xtensa/esp32s3/esp32s3-eye/scripts/Make.defs:
##########
@@ -23,13 +23,26 @@ include $(TOPDIR)/tools/Config.mk
 include $(TOPDIR)/tools/esp32s3/Config.mk
 include $(TOPDIR)/arch/xtensa/src/lx7/Toolchain.defs
 
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_out.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+# Pick the linker scripts from the board level if they exist, if not
+# pick the common linker scripts.
+
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
+
+ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld),)
+	ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld

Review Comment:
   Yes, that's exactly my point, NuttX coding standard does not provide any guideline to Makefile formatting and there is simply no consistency as of today.
   Still, I've applied your suggestions.



##########
boards/xtensa/esp32s3/esp32s3-eye/scripts/Make.defs:
##########
@@ -23,13 +23,26 @@ include $(TOPDIR)/tools/Config.mk
 include $(TOPDIR)/tools/esp32s3/Config.mk
 include $(TOPDIR)/arch/xtensa/src/lx7/Toolchain.defs
 
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_out.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+# Pick the linker scripts from the board level if they exist, if not
+# pick the common linker scripts.
+
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
+
+ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld),)
+	ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld

Review Comment:
   Yes, that's exactly my point, NuttX coding standard does not provide any guideline to Makefile formatting and there is simply no consistency as of today.
   Still, I've applied your suggestions.
   Thanks.



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7500: xtensa/esp32s3: Move linker scripts to folder common to all boards

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7500:
URL: https://github.com/apache/incubator-nuttx/pull/7500#discussion_r1010948385


##########
boards/xtensa/esp32s3/esp32s3-eye/scripts/Make.defs:
##########
@@ -23,13 +23,26 @@ include $(TOPDIR)/tools/Config.mk
 include $(TOPDIR)/tools/esp32s3/Config.mk
 include $(TOPDIR)/arch/xtensa/src/lx7/Toolchain.defs
 
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_out.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+# Pick the linker scripts from the board level if they exist, if not
+# pick the common linker scripts.
+
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
+
+ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld),)
+	ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld

Review Comment:
   I see that TABs are used for targets, but not for variables



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7500: xtensa/esp32s3: Move linker scripts to folder common to all boards

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7500:
URL: https://github.com/apache/incubator-nuttx/pull/7500#discussion_r1010947723


##########
boards/xtensa/esp32s3/esp32s3-eye/scripts/Make.defs:
##########
@@ -23,13 +23,26 @@ include $(TOPDIR)/tools/Config.mk
 include $(TOPDIR)/tools/esp32s3/Config.mk
 include $(TOPDIR)/arch/xtensa/src/lx7/Toolchain.defs
 
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_out.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+# Pick the linker scripts from the board level if they exist, if not
+# pick the common linker scripts.
+
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
+
+ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld),)
+	ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld

Review Comment:
   From file that you are pointing:
   ```
   # ARCHxxx means the predefined setting(either toolchain, arch, or system specific)
   
   ARCHDEFINES += ${shell $(DEFINE) "$(CC)" __NuttX__}
   ifeq ($(CONFIG_NDEBUG),y)
     ARCHDEFINES += ${shell $(DEFINE) "$(CC)" NDEBUG}
   endif
   
   # The default C/C++ search path
   
   ARCHINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include}
   
   ifeq ($(CONFIG_LIBCXX),y)
     ARCHXXINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include$(DELIM)libcxx}
   else ifeq ($(CONFIG_UCLIBCXX),y)
     ARCHXXINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include$(DELIM)uClibc++}
   else
     ARCHXXINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include$(DELIM)cxx}
     ifeq ($(CONFIG_ETL),y)
       ARCHXXINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include$(DELIM)etl}
     endif
   endif
   ARCHXXINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include}
   ```
   I'm referring to:
   ```
   boards/risc-v/mpfs/icicle/scripts/Make.defs
   boards/risc-v/esp32c3/esp32c3-devkit/scripts/Make.defs
   boards/arm/samv7/samv71-xult/configs/knsh/Make.defs
   ```
   and some others. Anyway I can unify style later



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko merged pull request #7500: xtensa/esp32s3: Move linker scripts to folder common to all boards

Posted by GitBox <gi...@apache.org>.
pkarashchenko merged PR #7500:
URL: https://github.com/apache/incubator-nuttx/pull/7500


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] gustavonihei commented on a diff in pull request #7500: xtensa/esp32s3: Move linker scripts to folder common to all boards

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on code in PR #7500:
URL: https://github.com/apache/incubator-nuttx/pull/7500#discussion_r1010875984


##########
boards/xtensa/esp32s3/esp32s3-devkit/src/Make.defs:
##########
@@ -49,13 +49,12 @@ ifeq ($(CONFIG_LCD_ST7735),y)
 CSRCS += esp32s3_st7735.c
 endif
 
-SCRIPTIN = $(SCRIPTDIR)$(DELIM)esp32s3.template.ld
 SCRIPTOUT = $(SCRIPTDIR)$(DELIM)esp32s3_out.ld
 
 .PHONY = context distclean
 
-$(SCRIPTOUT): $(SCRIPTIN) $(CONFIGFILE)
-	$(Q) $(CC) -isystem $(TOPDIR)/include -C -P -x c -E $(SCRIPTIN) -o $@
+$(SCRIPTOUT): $(LDSCRIPT_TEMPLATE) $(CONFIGFILE)
+	$(Q) $(CC) -isystem $(TOPDIR)/include -I $(BOARD_COMMON_DIR)$(DELIM)scripts -C -P -x c -E $(LDSCRIPT_TEMPLATE) -o $@

Review Comment:
   Thanks for the tip! I've modified the Makefiles, but now this PR depends on the fix from #7503 being merged first.



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] gustavonihei commented on a diff in pull request #7500: xtensa/esp32s3: Move linker scripts to folder common to all boards

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on code in PR #7500:
URL: https://github.com/apache/incubator-nuttx/pull/7500#discussion_r1010942005


##########
boards/xtensa/esp32s3/esp32s3-eye/scripts/Make.defs:
##########
@@ -23,13 +23,26 @@ include $(TOPDIR)/tools/Config.mk
 include $(TOPDIR)/tools/esp32s3/Config.mk
 include $(TOPDIR)/arch/xtensa/src/lx7/Toolchain.defs
 
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_out.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+# Pick the linker scripts from the board level if they exist, if not
+# pick the common linker scripts.
+
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
+
+ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld),)
+	ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld

Review Comment:
   Sorry, but which other places?
   If we take https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk as an example, most lines are indented with tabs.



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7500: xtensa/esp32s3: Move linker scripts to folder common to all boards

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7500:
URL: https://github.com/apache/incubator-nuttx/pull/7500#discussion_r1010939798


##########
boards/xtensa/esp32s3/esp32s3-eye/scripts/Make.defs:
##########
@@ -23,13 +23,26 @@ include $(TOPDIR)/tools/Config.mk
 include $(TOPDIR)/tools/esp32s3/Config.mk
 include $(TOPDIR)/arch/xtensa/src/lx7/Toolchain.defs
 
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_out.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+# Pick the linker scripts from the board level if they exist, if not
+# pick the common linker scripts.
+
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
+ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom.ld
+
+ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld),)
+	ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld

Review Comment:
   ```suggestion
     ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s3_memory.ld
   ```
   as in other places in code tree



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org