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


##########
boards/arm/mps/mps3-an547/Kconfig:
##########
@@ -19,4 +18,9 @@ config MPS3_AN547_BL
        bool "mps3an547 BL"
 
 endchoice
-endif
+
+config MPS3_ARCH_GCOV

Review Comment:
   why not add a common option?



##########
libs/libbuiltin/compiler-rt/Make.defs:
##########
@@ -149,6 +149,31 @@ else
   CSRCS += floatundidf.c floatundisf.c floatundixf.c
 endif
 
+ifeq ($(CONFIG_COMPILER_RT_PROFILE),y)
+
+FLAGS += ${INCDIR_PREFIX}$(CURDIR)/compiler-rt/compiler-rt/lib/profile
+FLAGS += -Wno-strict-prototypes -Wno-shadow -Wno-cleardeprecated-pragma
+FLAGS += -Wno-deprecated-pragma -Wno-undef -Wno-incompatible-pointer-types
+FLAGS += -Wno-unknown-warning-option -Wno-deprecated-pragma
+FLAGS += -DCOMPILER_RT_HAS_UNAME
+
+# No code coverage analysis of the library is required
+FLAGS += -fno-profile-generate
+
+# profile support
+CSRCS += GCDAProfiling.c InstrProfilingBuffer.c InstrProfiling.c 
InstrProfilingFile.c InstrProfilingInternal.c

Review Comment:
   no change.



##########
boards/arm/mps/mps3-an547/configs/clang/defconfig:
##########
@@ -61,6 +64,7 @@ CONFIG_RAM_START=0x01000000
 CONFIG_RAW_BINARY=y
 CONFIG_READLINE_CMD_HISTORY=y
 CONFIG_RR_INTERVAL=200
+CONFIG_SCHED_GCOV=y

Review Comment:
   don't enable gcov and rt profile in one defconfig



##########
libs/libbuiltin/compiler-rt/CMakeLists.txt:
##########
@@ -406,6 +406,47 @@ if(CONFIG_BUILTIN_COMPILER_RT)
     list(APPEND RT_BUILTIN_SRCS floatundidf.c floatundisf.c floatundixf.c)
   endif()
 
+  if(CONFIG_COMPILER_RT_PROFILE)
+
+    target_include_directories(
+      compiler-rt PRIVATE ${CMAKE_CURRENT_LIST_DIR}/compiler-rt/lib/profile)
+
+    target_compile_options(
+      compiler-rt
+      PRIVATE -Wno-strict-prototypes
+              -Wno-shadow
+              -Wno-cleardeprecated-pragma
+              -Wno-deprecated-pragma
+              -Wno-undef
+              -Wno-incompatible-pointer-types
+              -Wno-unknown-warning-option
+              -Wno-deprecated-pragma
+              -DCOMPILER_RT_HAS_UNAME)
+
+    set(RT_PROFILE_SRCS
+        GCDAProfiling.c
+        InstrProfilingBuffer.c

Review Comment:
   no change



##########
boards/arm/mps/mps3-an547/scripts/Make.defs:
##########
@@ -32,6 +32,13 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
 CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
 AFLAGS := $(CFLAGS) -D__ASSEMBLY__
 
+# mps3-an547 clang gcov function
+
+ifeq ($(CONFIG_MPS3_ARCH_GCOV),y)
+  libarch.a: CFLAGS += -fprofile-generate --coverage
+  arm_systick.o: CFLAGS += -fno-profile-generate

Review Comment:
   why skip arm_systick



##########
boards/arm/mps/mps3-an547/scripts/Make.defs:
##########
@@ -32,6 +32,13 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
 CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
 AFLAGS := $(CFLAGS) -D__ASSEMBLY__
 
+# mps3-an547 clang gcov function
+
+ifeq ($(CONFIG_MPS3_ARCH_GCOV),y)
+  libarch.a: CFLAGS += -fprofile-generate --coverage

Review Comment:
   why only profile this library



##########
boards/arm/mps/mps3-an547/scripts/Make.defs:
##########
@@ -32,6 +32,13 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
 CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
 AFLAGS := $(CFLAGS) -D__ASSEMBLY__
 
+# mps3-an547 clang gcov function
+
+ifeq ($(CONFIG_MPS3_ARCH_GCOV),y)

Review Comment:
   change to the common option move to toolchain specific make/cmake file.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to