xiaoxiang781216 commented on code in PR #14472:
URL: https://github.com/apache/nuttx/pull/14472#discussion_r1813257950


##########
libs/libbuiltin/Kconfig:
##########
@@ -0,0 +1,28 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+comment "Toolchains Library Support"
+
+config TOOLCHAINS_BUILTIN
+       bool "Builtin toolchains support"
+       default n
+       ---help---
+               Choose to compile libraries related to toolchains into the OS
+
+config BUILTIN_COMPILER_RT

Review Comment:
   change to choice



##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -445,14 +445,18 @@ endif
 
 # Add the builtin library
 
-COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)
-ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y)
-  ifeq ($(wildcard $(COMPILER_RT_LIB)),)
-    # if "--print-libgcc-file-name" unable to find the correct libgcc PATH
-    # then go ahead and try "--print-file-name"
-    COMPILER_RT_LIB := $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) 
--print-file-name $(notdir $(COMPILER_RT_LIB))))
+ifneq ($(CONFIG_BUILTIN_COMPILER_RT),y)

Review Comment:
   ```suggestion
   ifeq ($(CONFIG_BUILTIN_TOOLCHAIN),y)
   ```



##########
tools/ProtectedLibs.mk:
##########
@@ -80,6 +80,13 @@ ifeq ($(CONFIG_HAVE_CXX),y)
 USERLIBS += staging$(DELIM)libxx$(LIBEXT)
 endif
 
+# Add toolchain library support
+
+ifeq ($(CONFIG_TOOLCHAINS_BUILTIN),y)
+USERLIBS += staging$(DELIM)libbuiltin$(LIBEXT)
+NUTTXLIBS += staging$(DELIM)libbuiltin$(LIBEXT)

Review Comment:
   ```suggestion
   NUTTXLIBS += staging$(DELIM)libkbuiltin$(LIBEXT)
   ```



##########
libs/libbuiltin/.gitignore:
##########
@@ -0,0 +1,3 @@
+/compiler-rt/compiler-rt

Review Comment:
   move to libbuiltin/compiler-rt



##########
tools/LibTargets.mk:
##########
@@ -202,6 +208,16 @@ endif
 staging$(DELIM)libnx$(LIBEXT): libs$(DELIM)libnx$(DELIM)libnx$(LIBEXT)
        $(Q) $(call INSTALL_LIB,$<,$@)
 
+ifeq ($(CONFIG_BUILD_FLAT),y)

Review Comment:
   move before line 181



##########
tools/Directories.mk:
##########
@@ -120,6 +120,13 @@ ifeq ($(CONFIG_HAVE_CXX),y)
 CONTEXTDIRS += libs$(DELIM)libxx
 endif
 
+# Add toolchain library support
+
+ifeq ($(CONFIG_TOOLCHAINS_BUILTIN), y)

Review Comment:
   ```suggestion
   ifeq ($(CONFIG_TOOLCHAINS_BUILTIN),y)
   ```



##########
libs/libbuiltin/Kconfig:
##########
@@ -0,0 +1,28 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+comment "Toolchains Library Support"
+
+config TOOLCHAINS_BUILTIN
+       bool "Builtin toolchains support"
+       default n
+       ---help---
+               Choose to compile libraries related to toolchains into the OS
+
+config BUILTIN_COMPILER_RT
+       bool "Builtin LLVM Compiler-rt"
+       depends on ARM_TOOLCHAIN_CLANG
+       select TOOLCHAINS_BUILTIN

Review Comment:
   why select TOOLCHAINS_BUILTIN



##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -445,14 +445,18 @@ endif
 
 # Add the builtin library
 
-COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)

Review Comment:
   update cmake file too



##########
tools/FlatLibs.mk:
##########
@@ -82,6 +82,13 @@ ifeq ($(CONFIG_HAVE_CXX),y)
 NUTTXLIBS += staging$(DELIM)libxx$(LIBEXT)
 endif
 
+# Add toolchain library support
+
+ifeq ($(CONFIG_TOOLCHAINS_BUILTIN),y)
+USERLIBS += staging$(DELIM)libbuiltin$(LIBEXT)

Review Comment:
   remove not use in flat build



##########
libs/libbuiltin/Kconfig:
##########
@@ -0,0 +1,28 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+comment "Toolchains Library Support"
+
+config TOOLCHAINS_BUILTIN

Review Comment:
   ```suggestion
   config BUILTIN_TOOLCHAIN
   ```



##########
tools/KernelLibs.mk:
##########
@@ -72,6 +72,13 @@ ifeq ($(CONFIG_HAVE_CXX),y)
 USERLIBS += staging$(DELIM)libxx$(LIBEXT)
 endif
 
+# Add toolchain library support
+
+ifeq ($(CONFIG_TOOLCHAINS_BUILTIN),y)
+USERLIBS += staging$(DELIM)libbuiltin$(LIBEXT)
+NUTTXLIBS += staging$(DELIM)libbuiltin$(LIBEXT)

Review Comment:
   ```suggestion
   NUTTXLIBS += staging$(DELIM)libkbuiltin$(LIBEXT)
   ```



##########
libs/libbuiltin/Kconfig:
##########
@@ -0,0 +1,28 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+comment "Toolchains Library Support"
+
+config TOOLCHAINS_BUILTIN
+       bool "Builtin toolchains support"
+       default n
+       ---help---
+               Choose to compile libraries related to toolchains into the OS
+
+config BUILTIN_COMPILER_RT
+       bool "Builtin LLVM Compiler-rt"
+       depends on ARM_TOOLCHAIN_CLANG

Review Comment:
   why depends on ARM_TOOLCHAIN_CLANG, compiler_rt should work with gcc too



##########
libs/libbuiltin/Kconfig:
##########
@@ -0,0 +1,28 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+comment "Toolchains Library Support"
+
+config TOOLCHAINS_BUILTIN
+       bool "Builtin toolchains support"

Review Comment:
   ```suggestion
        bool "Builtin toolchain support"
   ```



##########
tools/LibTargets.mk:
##########
@@ -31,6 +31,12 @@ libs$(DELIM)libc$(DELIM)libkc$(LIBEXT): pass2dep
 staging$(DELIM)libkc$(LIBEXT): libs$(DELIM)libc$(DELIM)libkc$(LIBEXT)
        $(Q) $(call INSTALL_LIB,$<,$@)
 
+libs$(DELIM)libbuiltin$(DELIM)libkbuiltin$(LIBEXT): pass2dep

Review Comment:
   move before line 28



##########
tools/Directories.mk:
##########
@@ -120,6 +120,13 @@ ifeq ($(CONFIG_HAVE_CXX),y)
 CONTEXTDIRS += libs$(DELIM)libxx
 endif
 
+# Add toolchain library support
+
+ifeq ($(CONFIG_TOOLCHAINS_BUILTIN), y)
+USERLIBS += staging$(DELIM)libbuiltin$(LIBEXT)

Review Comment:
   where add CONTEXTDIRS



##########
tools/ProtectedLibs.mk:
##########
@@ -80,6 +80,13 @@ ifeq ($(CONFIG_HAVE_CXX),y)
 USERLIBS += staging$(DELIM)libxx$(LIBEXT)
 endif
 
+# Add toolchain library support
+
+ifeq ($(CONFIG_TOOLCHAINS_BUILTIN),y)

Review Comment:
   ```suggestion
   ifeq ($(CONFIG_BUILTIN_TOOLCHAIN),)
   ```



##########
tools/KernelLibs.mk:
##########
@@ -72,6 +72,13 @@ ifeq ($(CONFIG_HAVE_CXX),y)
 USERLIBS += staging$(DELIM)libxx$(LIBEXT)
 endif
 
+# Add toolchain library support
+
+ifeq ($(CONFIG_TOOLCHAINS_BUILTIN),y)

Review Comment:
   ```suggestion
   ifeq ($(CONFIG_BUILTIN_TOOLCHAIN),)
   ```



##########
tools/ProtectedLibs.mk:
##########
@@ -80,6 +80,13 @@ ifeq ($(CONFIG_HAVE_CXX),y)
 USERLIBS += staging$(DELIM)libxx$(LIBEXT)
 endif
 
+# Add toolchain library support
+
+ifeq ($(CONFIG_TOOLCHAINS_BUILTIN),y)
+USERLIBS += staging$(DELIM)libbuiltin$(LIBEXT)

Review Comment:
   move after line 87



##########
tools/ProtectedLibs.mk:
##########
@@ -80,6 +80,13 @@ ifeq ($(CONFIG_HAVE_CXX),y)
 USERLIBS += staging$(DELIM)libxx$(LIBEXT)
 endif
 
+# Add toolchain library support

Review Comment:
   move before line 55



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to