From 4232a717f28967847406760da4a7636bb85418cb Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Mon, 11 Nov 2024 17:08:30 +0800 Subject: [PATCH] libbuilin/compiler_rt: Organize make.defs and eliminate compilation warnings Signed-off-by: wangmingrong1 --- libs/libbuiltin/compiler-rt/InstrProfilingPlatform.c | 12 ++++++------ libs/libbuiltin/compiler-rt/Make.defs | 9 ++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/libs/libbuiltin/compiler-rt/InstrProfilingPlatform.c b/libs/libbuiltin/compiler-rt/InstrProfilingPlatform.c index 8e466d600d..3de393c1bf 100644 --- a/libs/libbuiltin/compiler-rt/InstrProfilingPlatform.c +++ b/libs/libbuiltin/compiler-rt/InstrProfilingPlatform.c @@ -60,37 +60,37 @@ void __llvm_profile_register_names_function(void *NamesStart, COMPILER_RT_VISIBILITY const __llvm_profile_data *__llvm_profile_begin_data(void) { - return &__start__llvm_prf_data; + return (const __llvm_profile_data *)__start__llvm_prf_data; } COMPILER_RT_VISIBILITY const __llvm_profile_data *__llvm_profile_end_data(void) { - return &__end__llvm_prf_data; + return (const __llvm_profile_data *)__end__llvm_prf_data; } COMPILER_RT_VISIBILITY const char *__llvm_profile_begin_names(void) { - return &__start__llvm_prf_names; + return (const char *)__start__llvm_prf_names; } COMPILER_RT_VISIBILITY const char *__llvm_profile_end_names(void) { - return &__end__llvm_prf_names; + return (const char *)__end__llvm_prf_names; } COMPILER_RT_VISIBILITY char *__llvm_profile_begin_counters(void) { - return &__start__llvm_prf_cnts; + return (char *)__start__llvm_prf_cnts; } COMPILER_RT_VISIBILITY char *__llvm_profile_end_counters(void) { - return &__end__llvm_prf_cnts; + return (char *)__end__llvm_prf_cnts; } COMPILER_RT_VISIBILITY diff --git a/libs/libbuiltin/compiler-rt/Make.defs b/libs/libbuiltin/compiler-rt/Make.defs index 59f7b9f5bd..e44fc6ef58 100644 --- a/libs/libbuiltin/compiler-rt/Make.defs +++ b/libs/libbuiltin/compiler-rt/Make.defs @@ -74,8 +74,8 @@ ifeq ($(CONFIG_BUILTIN_COMPILER_RT),y) FLAGS += ${INCDIR_PREFIX}$(CURDIR)/compiler-rt/compiler-rt/lib/builtins FLAGS += ${INCDIR_PREFIX}$(CURDIR)/compiler-rt/compiler-rt/lib/builtins/${ARCH} -FLAGS += -Wno-shift-count-negative -Wno-constant-conversion -Wshift-count-overflow -FLAGS += -Wno-undef -Wno-incompatible-pointer-types -Wno-visibility -Wno-macro-redefined + +FLAGS += -Wno-undef -Wno-macro-redefined CSRCS += $(wildcard compiler-rt/compiler-rt/lib/builtins/*.c) ASRCS += $(wildcard compiler-rt/compiler-rt/lib/builtins/$(ARCH)/*.S) @@ -94,10 +94,9 @@ endif ifeq ($(CONFIG_COVERAGE_COMPILER_RT),y) FLAGS += ${INCDIR_PREFIX}$(CURDIR)/compiler-rt/compiler-rt/lib/profile -FLAGS += -Wno-cleardeprecated-pragma -Wno-deprecated-pragma -Wno-incompatible-pointer-types -FLAGS += -Wno-shadow -Wno-strict-prototypes -Wno-undef -Wno-unknown-warning-option + +FLAGS += -Wno-undef -Wno-strict-prototypes -Wno-shadow FLAGS += -DCOMPILER_RT_HAS_UNAME -FLAGS += -fno-profile-generate CSRCS += $(wildcard compiler-rt/compiler-rt/lib/profile/*.c) CPPSRCS += $(wildcard compiler-rt/compiler-rt/lib/profile/*.cpp)