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/03/16 07:28:32 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request #5756: sim: Enable garbage collection of unused input sections

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


   ## Summary
   
   sim: Enable garbage collection of unused input sections
   
   LDFLAGS += -Wl,--gc-sections
   
   GC should be enabled on arch/sim/src/Makefile:
   
   ```
   326   $(if $(CONFIG_HAVE_CXX),\
   327   $(Q) "$(CXX)" $(CFLAGS) $(LDFLAGS) -o $(TOPDIR)/$@ $(HEADOBJ) nuttx.rel $(HOSTOBJS) $(STDLIBS),\
   328   $(Q) "$(CC)" $(CFLAGS) $(LDFLAGS) -o $(TOPDIR)/$@ $(HEADOBJ) nuttx.rel $(HOSTOBJS) $(STDLIBS))
   ```
   
   ## Impact
   
   N/A
   
   ## Testing
   
   CI-CHECK


-- 
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] anchao commented on a change in pull request #5756: sim: Enable garbage collection of unused input sections

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



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -209,6 +209,11 @@ endif
 
 LDELFFLAGS = -r -e main --gc-sections
 LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDFLAGS += -Wl,--gc-sections
+
+ifeq ($(CONFIG_HOST_MACOS),y)
+  LDFLAGS += -Wl,-dead_strip
+endif

Review comment:
       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 a change in pull request #5756: sim: Enable garbage collection of unused input sections

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



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -209,6 +209,7 @@ endif
 
 LDELFFLAGS = -r -e main --gc-sections
 LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDFLAGS += -Wl,--gc-sections

Review comment:
       I think that `-Wl,-dead_strip` is needed for MAC




-- 
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] anchao commented on a change in pull request #5756: sim: Enable garbage collection of unused input sections

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



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -209,6 +209,7 @@ endif
 
 LDELFFLAGS = -r -e main --gc-sections
 LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDFLAGS += -Wl,--gc-sections

Review comment:
       LDFLAGS is different with LDELFFLAGS, LDELFFLAGS used in loadable applications




-- 
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 #5756: sim: Enable garbage collection of unused input sections

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



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -209,6 +209,7 @@ endif
 
 LDELFFLAGS = -r -e main --gc-sections
 LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDFLAGS += -Wl,--gc-sections

Review comment:
       Do we need to remove `--gc-sections` from `LDELFFLAGS`?




-- 
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 #5756: sim: Enable garbage collection of unused input sections

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



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -209,6 +209,11 @@ endif
 
 LDELFFLAGS = -r -e main --gc-sections
 LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDFLAGS += -Wl,--gc-sections
+
+ifeq ($(CONFIG_HOST_MACOS),y)
+  LDFLAGS += -Wl,-dead_strip
+endif

Review comment:
       Probably gc-sections should be in else case




-- 
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 #5756: sim: Enable garbage collection of unused input sections

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


   


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