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/26 02:57:55 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5332: arch/Toolchain.defs: Simplify addition builtin library to EXTRA_LIBS

xiaoxiang781216 commented on a change in pull request #5332:
URL: https://github.com/apache/incubator-nuttx/pull/5332#discussion_r792282163



##########
File path: arch/arm/src/arm/Toolchain.defs
##########
@@ -103,21 +103,12 @@ OBJDUMP = $(CROSSDEV)objdump
 
 # Add the builtin library
 
-EXTRA_LIBS += -lgcc
-EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
+EXTRA_LIBS := ${shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libgcc.a}
 
 ifneq ($(CONFIG_LIBM),y)
-  LIBM_PATH = "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
-  
-  # Check if libm is provided by the compiler
-  
-  ifneq ($(LIBM_PATH),".")
-    EXTRA_LIBS += -lm
-    EXTRA_LIBPATHS += -L $(LIBM_PATH)
-  endif
+  EXTRA_LIBS += ${wildcard ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}

Review comment:
       Two reason:
   
   1. CONFIG_LIBM isn't enabled by default, so libm.a will be searched by default.
   2. But the toolchain doesn't contain libm.a library
   
   Here is the related change: https://github.com/apache/incubator-nuttx/pull/5309 




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