• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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
16if (defined(ohos_lite)) {
17  executable("crasher_cpp") {
18    cflags = [
19      "-funwind-tables",
20      "-Wno-frame-larger-than",
21    ]
22    defines = [ "is_ohos_lite" ]
23    visibility = [ "*:*" ]
24    include_dirs = [
25      ".",
26      "$faultloggerd_interfaces_path/common",
27      "$faultloggerd_interfaces_path/innerkits/async_stack/include",
28      "$faultloggerd_path/example",
29      "$hilog_lite_include_path",
30    ]
31    sources = [ "dfx_crasher.cpp" ]
32    deps = [
33      "$faultloggerd_interfaces_path/innerkits/async_stack:libasync_stack",
34      "$hilog_lite_deps_path",
35    ]
36
37    external_deps = [ "bounds_checking_function:libsec_shared" ]
38  }
39} else {
40  config("crasher_config") {
41    visibility = [ ":*" ]
42
43    include_dirs = [
44      ".",
45      "$faultloggerd_interfaces_path/common",
46      "$faultloggerd_path/example",
47    ]
48
49    cflags = [
50      "-DHAS_HITRACE",
51      "-DHAS_CRASH_EXAMPLES",
52      "-Wno-frame-larger-than",
53      "-Wno-frame-address",
54    ]
55    cflags_c = [ "-Wno-frame-larger-than" ]
56    cflags_cc = [
57      "-Wno-frame-larger-than",
58      "-o0",
59    ]
60    ldflags = [ "-Wno-frame-larger-than" ]
61  }
62
63  ohos_executable("crasher_cpp") {
64    configs = [
65      ":crasher_config",
66      "$faultloggerd_path/common/build:coverage_flags",
67    ]
68
69    sources = [ "dfx_crasher.cpp" ]
70    sources += [
71      "faults/ipc_issues.cpp",
72      "faults/multi_thread_container_access.cpp",
73      "faults/nullpointer_dereference.cpp",
74      "faults/parcel_sample.cpp",
75      "faults/remote_object_interface_proxy.cpp",
76      "faults/remote_object_interface_stub.cpp",
77    ]
78
79    branch_protector_ret = "pac_ret"
80
81    deps =
82        [ "$faultloggerd_interfaces_path/innerkits/async_stack:libasync_stack" ]
83
84    external_deps = [
85      "c_utils:utils",
86      "ffrt:libffrt",
87      "hilog:libhilog",
88      "hitrace:libhitracechain",
89      "ipc:ipc_single",
90      "libuv:uv",
91    ]
92
93    part_name = "faultloggerd"
94    subsystem_name = "hiviewdfx"
95  }
96}
97