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/01/25 04:44:13 UTC

[GitHub] [incubator-nuttx] no1wudi opened a new pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

no1wudi opened a new pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330


   ## Summary
   
   ## Impact
   None
   ## Testing
   CI and custom board
   


-- 
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] no1wudi commented on a change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
no1wudi commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791399675



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       I see aligned_data is from compiler.h, but the etctmp.c is generated dynamically and wouldn't include any header. 

##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       4 byte align should suitable for all target (with or without unaligned access support), by this way we must add many duplicated code to their linker script.

##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       4 byte align should suitable be for all target (with or without unaligned access support), by this way we must add many duplicated code to their linker script.

##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       Thanks, done




-- 
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 #5330: board/Board.mk: Make romfs_img 4 byte aligned

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


   


-- 
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] no1wudi commented on a change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
no1wudi commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791569995



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       4 byte align should suitable for all target (with or without unaligned access support), by this way we must add many duplicated code to their linker script.




-- 
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 #5330: board/Board.mk: Make romfs_img 4 byte aligned

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


   


-- 
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 change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791400330



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       It's hard or unnecessary to include compiler.h for the dynamic generated code.




-- 
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 change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791613128



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       > It's hard or unnecessary to include compiler.h to use aligned_data for the dynamic generated code.
   
   I think it should be easy to change
   ```
   $(Q) echo "#include <compiler.h>" > $@
   $(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" >> $@
   ```




-- 
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 change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791400330



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       It's hard or unnecessary to include compiler.h for the dynamic generated code.

##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       It's hard or unnecessary to include compiler.h to use aligned_data for the dynamic generated code.




-- 
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 change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791527022



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       I'm just thinking that maybe different alignment is needed for different targets.
   Isn't the proper way to set alignment in linker script? Like
   ```
   . = ALIGN (4);
   KEEP (*(.romfs_img))
   ```
   ???




-- 
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] no1wudi commented on a change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
no1wudi commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791569995



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       4 byte align should suitable be for all target (with or without unaligned access support), by this way we must add many duplicated code to their linker script.




-- 
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] no1wudi commented on a change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
no1wudi commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791664900



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       Thanks, done




-- 
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 pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#issuecomment-1022287430


   @no1wudi shouldn't https://github.com/apache/incubator-nuttx/blob/master/tools/mkromfsimg.sh he updated as well?


-- 
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 change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791400330



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       It's hard or unnecessary to include compiler.h to use aligned_data for the dynamic generated code.




-- 
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 change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791613128



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       > It's hard or unnecessary to include compiler.h to use aligned_data for the dynamic generated code.
   
   I think it should be easy to change
   ```
   $(Q) echo "#include <nuttx/compiler.h>" > $@
   $(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" >> $@
   ```




-- 
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] no1wudi commented on a change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
no1wudi commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791399675



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       I see aligned_data is from compiler.h, but the etctmp.c is generated dynamically and wouldn't include any header. 




-- 
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 change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791396070



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       Should we used `aligned_data` from compiler.mk?




-- 
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 change in pull request #5330: board/Board.mk: Make romfs_img 4 byte aligned

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5330:
URL: https://github.com/apache/incubator-nuttx/pull/5330#discussion_r791396070



##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       Should we used `aligned_data` from compiler.mk?

##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       I'm just thinking that maybe different alignment is needed for different targets.
   Isn't the proper way to set alignment in linker script? Like
   ```
   . = ALIGN (4);
   KEEP (*(.romfs_img))
   ```
   ???

##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       > It's hard or unnecessary to include compiler.h to use aligned_data for the dynamic generated code.
   
   I think it should be easy to change
   ```
   $(Q) echo "#include <compiler.h>" > $@
   $(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" >> $@
   ```

##########
File path: boards/Board.mk
##########
@@ -36,7 +36,7 @@ $(ETCSRC): $(RCRAWS) $(RCOBJS)
 	  $(shell mkdir -p $(dir $(ETCDIR)$(DELIM)$(raw))) \
 	  $(shell cp -rfp $(raw) $(ETCDIR)$(DELIM)$(raw)))
 	$(Q) genromfs -f romfs.img -d $(ETCDIR)$(DELIM)$(CONFIG_NSH_ROMFSMOUNTPT) -V "$(basename $<)"
-	$(Q) xxd -i romfs.img | sed -e "s/^unsigned/const unsigned/g" > $@
+	$(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char __attribute__((aligned(4)))/g" > $@

Review comment:
       > It's hard or unnecessary to include compiler.h to use aligned_data for the dynamic generated code.
   
   I think it should be easy to change
   ```
   $(Q) echo "#include <nuttx/compiler.h>" > $@
   $(Q) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" >> $@
   ```




-- 
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