• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//base/hiviewdfx/faultloggerd/faultloggerd.gni")
15
16dumpcatcher_sources = [
17  "dfx_dump_catcher.cpp",
18  "dfx_dump_catcher_errno.cpp",
19  "dfx_dump_catcher_slow_policy.cpp",
20  "kernel_stack_async_collector.cpp",
21]
22
23if (defined(ohos_lite)) {
24  shared_library("libdfx_dumpcatcher") {
25    visibility = [ "*:*" ]
26
27    include_dirs = [
28      "include",
29      "$c_utils_include_path",
30      "$faultloggerd_common_path/dfxlog",
31      "$faultloggerd_common_path/dfxutil",
32      "$faultloggerd_interfaces_path/common",
33      "$faultloggerd_interfaces_path/innerkits/backtrace/include",
34      "$faultloggerd_interfaces_path/innerkits/faultloggerd_client/include",
35      "$faultloggerd_interfaces_path/innerkits/procinfo/include",
36      "$hilog_lite_include_path",
37    ]
38
39    sources = dumpcatcher_sources
40
41    cflags = [ "-fstack-protector-strong" ]
42
43    deps = [
44      "$faultloggerd_common_path/dfxlog:dfx_hilog",
45      "$faultloggerd_common_path/dfxutil:dfx_util",
46      "$faultloggerd_common_path/trace:dfx_trace_dlsym",
47      "$faultloggerd_interfaces_path/innerkits/backtrace:libbacktrace_local",
48      "$faultloggerd_interfaces_path/innerkits/faultloggerd_client:libfaultloggerd",
49      "$faultloggerd_interfaces_path/innerkits/procinfo:libdfx_procinfo",
50    ]
51
52    external_deps = [
53      "bounds_checking_function:libsec_shared",
54      "hilog_lite:hilog_shared",
55    ]
56  }
57} else {
58  config("dfx_dump_catcher_config") {
59    visibility = [ "*:*" ]
60    include_dirs = [ "include" ]
61    if (is_emulator) {
62      defines = [ "IS_EMULATOR" ]
63    }
64  }
65
66  ohos_shared_library("libdfx_dumpcatcher") {
67    branch_protector_ret = "pac_ret"
68    public_configs = [
69      ":dfx_dump_catcher_config",
70      "$faultloggerd_path/common/build:coverage_flags",
71    ]
72    sources = dumpcatcher_sources
73    sources += [ "lite_perf.cpp" ]
74    cflags = [ "-fstack-protector-strong" ]
75    include_dirs = [ "$faultloggerd_interfaces_path/common" ]
76    version_script = "libdfx_dumpcatcher.map"
77    deps = [
78      "$faultloggerd_common_path/dfxlog:dfx_hilog",
79      "$faultloggerd_common_path/dfxutil:dfx_util",
80      "$faultloggerd_common_path/trace:dfx_trace_dlsym",
81      "$faultloggerd_interfaces_path/innerkits/backtrace:libbacktrace_local",
82      "$faultloggerd_interfaces_path/innerkits/faultloggerd_client:libfaultloggerd",
83      "$faultloggerd_interfaces_path/innerkits/procinfo:libdfx_procinfo",
84      "$faultloggerd_path/interfaces/innerkits/signal_handler:dfx_signalhandler",
85      "$faultloggerd_interfaces_path/innerkits/stack_printer:libstack_printer",
86      "$faultloggerd_interfaces_path/innerkits/unwinder:libunwinder",
87    ]
88
89    external_deps = [
90      "c_utils:utils",
91      "hilog:libhilog",
92    ]
93    install_images = [
94      "system",
95      "updater",
96    ]
97    innerapi_tags = [
98      "chipsetsdk_sp_indirect",
99      "platformsdk_indirect",
100    ]
101    part_name = "faultloggerd"
102    subsystem_name = "hiviewdfx"
103  }
104}
105