From 2b84c47b828dba486ca70ed9fa684935b4350b19 Mon Sep 17 00:00:00 2001 From: xwx1135370 Date: Tue, 17 Dec 2024 19:16:44 +0800 Subject: [PATCH] =?UTF-8?q?[Bug]:=20c=5Futils=E9=83=A8=E4=BB=B6=E5=8C=96?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit issue:https://gitee.com/openharmony/build/issues/IBB4XA?from=project-issue Signed-off-by: xwx1135370 --- example/BUILD.gn | 3 ++- faultloggerd.gni | 2 -- interfaces/innerkits/backtrace/BUILD.gn | 2 +- interfaces/innerkits/dump_catcher/BUILD.gn | 2 +- interfaces/innerkits/faultloggerd_client/BUILD.gn | 3 +-- interfaces/innerkits/procinfo/BUILD.gn | 7 ++++--- interfaces/innerkits/signal_handler/BUILD.gn | 6 ++++-- interfaces/innerkits/unwinder/BUILD.gn | 14 ++++++++------ services/BUILD.gn | 7 ++++--- test/performancetest/BUILD.gn | 6 ++++-- test/systemtest/BUILD.gn | 7 ++++--- test/unittest/common/BUILD.gn | 2 +- test/unittest/process_dump/BUILD.gn | 7 ++++--- test/unittest/procinfo/BUILD.gn | 2 +- test/unittest/services/BUILD.gn | 3 +-- test/utils/BUILD.gn | 2 +- tools/process_dump/BUILD.gn | 3 ++- 17 files changed, 43 insertions(+), 35 deletions(-) diff --git a/example/BUILD.gn b/example/BUILD.gn index 46fc0c879..779d466ee 100644 --- a/example/BUILD.gn +++ b/example/BUILD.gn @@ -24,7 +24,6 @@ if (defined(ohos_lite)) { include_dirs = [ ".", - "$c_utils_include_path", "$faultloggerd_common_path/dfxlog", "$faultloggerd_common_path/dfxutil", "$faultloggerd_interfaces_path/common", @@ -41,6 +40,8 @@ if (defined(ohos_lite)) { "$faultloggerd_interfaces_path/innerkits/faultloggerd_client:libfaultloggerd", "$hilog_lite_deps_path", ] + + external_deps = [ "c_utils:utils" ] } } else { config("dumpcatcherdemo_config") { diff --git a/faultloggerd.gni b/faultloggerd.gni index 36495e876..f7518e817 100644 --- a/faultloggerd.gni +++ b/faultloggerd.gni @@ -33,8 +33,6 @@ declare_args() { if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") - c_utils_include_path = "//commonlibrary/c_utils/base/include" - c_utils_src_path = "//commonlibrary/c_utils/base/src" if (ohos_kernel_type == "liteos_m") { hilog_lite_include_path = "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite" diff --git a/interfaces/innerkits/backtrace/BUILD.gn b/interfaces/innerkits/backtrace/BUILD.gn index 9465d6cc8..ce68bc851 100644 --- a/interfaces/innerkits/backtrace/BUILD.gn +++ b/interfaces/innerkits/backtrace/BUILD.gn @@ -25,7 +25,6 @@ if (defined(ohos_lite)) { include_dirs = [ "include", - "$c_utils_include_path", "$faultloggerd_common_path/dfxlog", "$faultloggerd_common_path/dfxutil", "$faultloggerd_interfaces_path/common", @@ -46,6 +45,7 @@ if (defined(ohos_lite)) { external_deps = [ "bounds_checking_function:libsec_shared", + "c_utils:utils", "hilog_lite:hilog_shared", ] } diff --git a/interfaces/innerkits/dump_catcher/BUILD.gn b/interfaces/innerkits/dump_catcher/BUILD.gn index 730473dbe..e4bebcf29 100644 --- a/interfaces/innerkits/dump_catcher/BUILD.gn +++ b/interfaces/innerkits/dump_catcher/BUILD.gn @@ -21,7 +21,6 @@ if (defined(ohos_lite)) { include_dirs = [ "include", - "$c_utils_include_path", "$faultloggerd_common_path/dfxlog", "$faultloggerd_common_path/dfxutil", "$faultloggerd_interfaces_path/common", @@ -46,6 +45,7 @@ if (defined(ohos_lite)) { external_deps = [ "bounds_checking_function:libsec_shared", + "c_utils:utils", "hilog_lite:hilog_shared", ] } diff --git a/interfaces/innerkits/faultloggerd_client/BUILD.gn b/interfaces/innerkits/faultloggerd_client/BUILD.gn index b16363470..5d6772ed3 100644 --- a/interfaces/innerkits/faultloggerd_client/BUILD.gn +++ b/interfaces/innerkits/faultloggerd_client/BUILD.gn @@ -20,7 +20,6 @@ if (defined(ohos_lite)) { include_dirs = [ ".", "include", - "$c_utils_include_path", "$faultloggerd_common_path/cutil", "$faultloggerd_common_path/dfxlog", "$faultloggerd_common_path/dfxutil", @@ -32,7 +31,6 @@ if (defined(ohos_lite)) { "faultloggerd_socket.cpp", ] cflags = [ "-fstack-protector-strong" ] - sources += [ "$c_utils_src_path/directory_ex.cpp" ] deps = [ "$faultloggerd_path/common/cutil:dfx_cutil", @@ -41,6 +39,7 @@ if (defined(ohos_lite)) { ] external_deps = [ + "c_utils:utils", "hilog_lite:hilog_shared", "init:libbegetutil", ] diff --git a/interfaces/innerkits/procinfo/BUILD.gn b/interfaces/innerkits/procinfo/BUILD.gn index 38fc12821..52d1debcd 100644 --- a/interfaces/innerkits/procinfo/BUILD.gn +++ b/interfaces/innerkits/procinfo/BUILD.gn @@ -20,21 +20,22 @@ if (defined(ohos_lite)) { include_dirs = [ ".", "include", - "$c_utils_include_path", "$faultloggerd_interfaces_path/common", "$faultloggerd_path/common/dfxutil", "$hilog_lite_include_path", ] sources = [ "procinfo.cpp" ] - sources += [ "$c_utils_src_path/directory_ex.cpp" ] deps = [ "$faultloggerd_path/common/dfxutil:dfx_util", "$hilog_lite_deps_path", ] - external_deps = [ "bounds_checking_function:libsec_shared" ] + external_deps = [ + "c_utils:utils", + "bounds_checking_function:libsec_shared" + ] } } else { config("dfx_procinfo_config") { diff --git a/interfaces/innerkits/signal_handler/BUILD.gn b/interfaces/innerkits/signal_handler/BUILD.gn index cd287677e..0c4dd2dfc 100644 --- a/interfaces/innerkits/signal_handler/BUILD.gn +++ b/interfaces/innerkits/signal_handler/BUILD.gn @@ -53,7 +53,6 @@ if (defined(ohos_lite)) { visibility = [ "*:*" ] include_dirs = [ "include", - "$c_utils_include_path", "$faultloggerd_interfaces_path/common", "$faultloggerd_path/common/cutil", "$faultloggerd_path/common/dfxlog", @@ -66,7 +65,10 @@ if (defined(ohos_lite)) { deps = [ "$faultloggerd_path/common/cutil:dfx_cutil" ] - external_deps = [ "bounds_checking_function:libsec_shared" ] + external_deps = [ + "c_utils:utils", + "bounds_checking_function:libsec_shared" + ] cflags = [ "-fPIC", diff --git a/interfaces/innerkits/unwinder/BUILD.gn b/interfaces/innerkits/unwinder/BUILD.gn index 6633df20e..08f547741 100644 --- a/interfaces/innerkits/unwinder/BUILD.gn +++ b/interfaces/innerkits/unwinder/BUILD.gn @@ -65,7 +65,6 @@ if (defined(ohos_lite)) { include_dirs = [ "include", - "$c_utils_include_path", "$faultloggerd_common_path/dfxlog", "$faultloggerd_common_path/dfxutil", "$faultloggerd_interfaces_path/common", @@ -76,7 +75,6 @@ if (defined(ohos_lite)) { sources = dfx_unwinder_sources sources += dfx_exidx_sources sources += dfx_dwarf_sources - sources += [ "$c_utils_src_path/directory_ex.cpp" ] deps = [ "$faultloggerd_common_path/dfxlog:dfx_hilog", @@ -85,7 +83,10 @@ if (defined(ohos_lite)) { "$hilog_lite_deps_path", ] - external_deps = [ "bounds_checking_function:libsec_shared" ] + external_deps = [ + "c_utils:utils", + "bounds_checking_function:libsec_shared" + ] } static_library("libunwinder_static") { @@ -95,7 +96,6 @@ if (defined(ohos_lite)) { include_dirs = [ "include", - "$c_utils_include_path", "$faultloggerd_common_path/dfxlog", "$faultloggerd_common_path/dfxutil", "$faultloggerd_interfaces_path/common", @@ -106,7 +106,6 @@ if (defined(ohos_lite)) { sources = dfx_unwinder_sources sources += dfx_exidx_sources sources += dfx_dwarf_sources - sources += [ "$c_utils_src_path/directory_ex.cpp" ] deps = [ "$faultloggerd_common_path/dfxlog:dfx_hilog", @@ -114,7 +113,10 @@ if (defined(ohos_lite)) { "$faultloggerd_common_path/trace:dfx_trace_dlsym", "$hilog_lite_deps_path", ] - external_deps = [ "bounds_checking_function:libsec_shared" ] + external_deps = [ + "c_utils:utils", + "bounds_checking_function:libsec_shared" + ] } static_library("unwinder_host") { diff --git a/services/BUILD.gn b/services/BUILD.gn index 56aae6892..a98286ef7 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -36,7 +36,6 @@ if (defined(ohos_lite)) { include_dirs = [ ".", - "$c_utils_include_path", "$faultloggerd_interfaces_path/common", "$faultloggerd_path/common/dfxlog", "$faultloggerd_path/common/dfxutil", @@ -47,7 +46,6 @@ if (defined(ohos_lite)) { ] sources = faultloggerd_sources - sources += [ "$c_utils_src_path/directory_ex.cpp" ] cflags = [ "-fstack-protector-strong" ] @@ -59,7 +57,10 @@ if (defined(ohos_lite)) { "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd", ] - external_deps = [ "hilog_lite:hilog_shared" ] + external_deps = [ + "c_utils:utils", + "hilog_lite:hilog_shared" + ] defines = [ "is_ohos_lite" ] if (faultloggerd_hisysevent_enable) { diff --git a/test/performancetest/BUILD.gn b/test/performancetest/BUILD.gn index 636e565da..71ca1d562 100644 --- a/test/performancetest/BUILD.gn +++ b/test/performancetest/BUILD.gn @@ -25,7 +25,6 @@ if (defined(ohos_lite)) { include_dirs = [ "include/", - "$c_utils_include_path", "$faultloggerd_interfaces_path/common", "$faultloggerd_interfaces_path/innerkits/procinfo/include", "$faultloggerd_interfaces_path/innerkits/faultloggerd_client/include", @@ -40,7 +39,10 @@ if (defined(ohos_lite)) { "$faultloggerd_path/test/utils:dfx_test_util", ] - external_deps = [ "hilog_lite:hilog_shared" ] + external_deps = [ + "c_utils:utils", + "hilog_lite:hilog_shared" + ] } } diff --git a/test/systemtest/BUILD.gn b/test/systemtest/BUILD.gn index 70525d301..5042a21f9 100644 --- a/test/systemtest/BUILD.gn +++ b/test/systemtest/BUILD.gn @@ -25,10 +25,8 @@ if (defined(ohos_lite)) { "dumpcatcher_system_test.cpp", "faultloggerd_system_test.cpp", ] - sources += [ "$c_utils_src_path/directory_ex.cpp" ] include_dirs = [ - "$c_utils_include_path", "$faultloggerd_common_path/dfxutil", "$faultloggerd_interfaces_path/innerkits/backtrace/include", "$faultloggerd_path/interfaces/common", @@ -45,7 +43,10 @@ if (defined(ohos_lite)) { "$faultloggerd_path/test/utils:dfx_test_util", ] - external_deps = [ "hilog_lite:hilog_shared" ] + external_deps = [ + "c_utils:utils", + "hilog_lite:hilog_shared" + ] } } diff --git a/test/unittest/common/BUILD.gn b/test/unittest/common/BUILD.gn index 9cea7974e..df05e6717 100644 --- a/test/unittest/common/BUILD.gn +++ b/test/unittest/common/BUILD.gn @@ -23,7 +23,6 @@ if (defined(ohos_lite)) { output_dir = "$root_out_dir/test/unittest/faultloggerd" include_dirs = [ - "$c_utils_include_path", "$hilog_lite_include_path", "$faultloggerd_interfaces_path/common", "$faultloggerd_path/common/dfxlog", @@ -38,6 +37,7 @@ if (defined(ohos_lite)) { "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd", "$hilog_lite_deps_path", ] + external_deps = [ "c_utils:utils" ] } } diff --git a/test/unittest/process_dump/BUILD.gn b/test/unittest/process_dump/BUILD.gn index 212de7221..6a8b5e31f 100644 --- a/test/unittest/process_dump/BUILD.gn +++ b/test/unittest/process_dump/BUILD.gn @@ -23,7 +23,6 @@ if (defined(ohos_lite)) { output_dir = "$root_out_dir/test/unittest/faultloggerd" include_dirs = [ - "$c_utils_include_path", "$faultloggerd_common_path/dfxutil", "$faultloggerd_interfaces_path/common", "$faultloggerd_interfaces_path/innerkits/procinfo/include", @@ -37,7 +36,6 @@ if (defined(ohos_lite)) { "multithread_constructor.c", "process_dump_test.cpp", ] - sources += [ "$c_utils_src_path/directory_ex.cpp" ] deps = [ "$faultloggerd_interfaces_path/innerkits/procinfo:libdfx_procinfo", @@ -46,7 +44,10 @@ if (defined(ohos_lite)) { "$faultloggerd_path/tools/process_dump:process_info_src", ] - external_deps = [ "hilog_lite:hilog_shared" ] + external_deps = [ + "c_utils:utils", + "hilog_lite:hilog_shared" + ] } } diff --git a/test/unittest/procinfo/BUILD.gn b/test/unittest/procinfo/BUILD.gn index 0ec54f7ea..f29fa7d0f 100644 --- a/test/unittest/procinfo/BUILD.gn +++ b/test/unittest/procinfo/BUILD.gn @@ -23,7 +23,6 @@ if (defined(ohos_lite)) { output_dir = "$root_out_dir/test/unittest/faultloggerd" include_dirs = [ - "$c_utils_include_path", "$faultloggerd_interfaces_path/common", "$faultloggerd_path/common/dfxlog", "$faultloggerd_path/common/dfxutil", @@ -39,6 +38,7 @@ if (defined(ohos_lite)) { "$faultloggerd_path/interfaces/innerkits/procinfo:libdfx_procinfo", "$hilog_lite_deps_path", ] + external_deps = [ "c_utils:utils" ] } } diff --git a/test/unittest/services/BUILD.gn b/test/unittest/services/BUILD.gn index e9c628b2a..d1189b6c2 100644 --- a/test/unittest/services/BUILD.gn +++ b/test/unittest/services/BUILD.gn @@ -23,7 +23,6 @@ if (defined(ohos_lite)) { output_dir = "$root_out_dir/test/unittest/faultloggerd" include_dirs = [ - "$c_utils_include_path", "$faultloggerd_path/services", "$hilog_lite_include_path", "$faultloggerd_path/tools/process_dump", @@ -44,7 +43,6 @@ if (defined(ohos_lite)) { "$faultloggerd_path/services/fault_logger_pipe.cpp", "faultlogger_config_test.cpp", ] - sources += [ "$c_utils_src_path/directory_ex.cpp" ] deps = [ "$faultloggerd_common_path/trace:dfx_trace", @@ -55,6 +53,7 @@ if (defined(ohos_lite)) { ] external_deps = [ + "c_utils:utils", "hilog_lite:hilog_shared", "init:libbegetutil", ] diff --git a/test/utils/BUILD.gn b/test/utils/BUILD.gn index 1d602f0f8..27b994d95 100644 --- a/test/utils/BUILD.gn +++ b/test/utils/BUILD.gn @@ -20,13 +20,13 @@ if (defined(ohos_lite)) { visibility = [ "*:*" ] include_dirs = [ ".", - "$c_utils_include_path", "$hilog_lite_include_path", "$faultloggerd_interfaces_path/common", "$faultloggerd_path/common/dfxutil", ] sources = dfx_test_util_sources deps = [ "$hilog_lite_deps_path" ] + external_deps = [ "c_utils:utils" ] } } else { ohos_static_library("dfx_test_util") { diff --git a/tools/process_dump/BUILD.gn b/tools/process_dump/BUILD.gn index 8779daefe..02e4862de 100644 --- a/tools/process_dump/BUILD.gn +++ b/tools/process_dump/BUILD.gn @@ -41,7 +41,6 @@ if (defined(ohos_lite)) { include_dirs = [ ".", - "$c_utils_include_path", "$faultloggerd_common_path/dfxlog", "$faultloggerd_common_path/dfxutil", "$faultloggerd_interfaces_path/common", @@ -74,6 +73,7 @@ if (defined(ohos_lite)) { "$faultloggerd_interfaces_path/innerkits/unwinder:libunwinder", ] external_deps = [ "hilog_lite:hilog_shared" ] + public_external_deps = [ "c_utils:utils" ] } executable("processdump") { @@ -97,6 +97,7 @@ if (defined(ohos_lite)) { ] external_deps = [ "hilog_lite:hilog_shared" ] + public_external_deps = [ "c_utils:utils" ] } } else { config("processdump_config") { -- Gitee