• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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("../../../test_template.gni")
15
16group("ldso_cfi_test") {
17  testonly = true
18  deps = [
19    ":cfi_avaiable_schemes_test",
20    ":cfi_cross_dso_test_exe",
21    ":cfi_cross_dso_test_lib",
22    ":ldso_cfi_check",
23    ":ldso_cfi_test_lib",
24  ]
25}
26
27ohos_executable("ldso_cfi_check") {
28  subsystem_name = "musl"
29  part_name = "libc-test"
30  include_dirs = [
31    "../common",
32    "//third_party/musl/porting/linux/user/include",
33    "//third_party/musl/porting/linux/user/ldso",
34    "//third_party/musl/libc-test/src/common",
35  ]
36
37  sources = [ "ldso_cfi_check.c" ]
38  configs = [ "//third_party/musl/libc-test/src/common:config_runtest" ]
39}
40
41ohos_shared_library("ldso_cfi_test_lib") {
42  include_dirs = [ "." ]
43  sources = [ "ldso_cfi_test_lib.c" ]
44
45  output_name = "ldso_cfi_test_lib"
46  output_extension = "so"
47  subsystem_name = "musl"
48  part_name = "libc-test-lib"
49}
50
51ohos_shared_library("cfi_cross_dso_test_lib") {
52  sanitize = {
53    cfi = true
54    cfi_cross_dso = true
55    debug = true
56  }
57  subsystem_name = "musl"
58  part_name = "libc-test-lib"
59  include_dirs = [
60    "../common",
61    "//third_party/musl/porting/linux/user/include",
62    "//third_party/musl/porting/linux/user/ldso",
63    "//third_party/musl/libc-test/src/common",
64  ]
65  use_rtti = true
66
67  sources = [ "./crossdso/cfi_test_lib.cpp" ]
68}
69
70ohos_executable("cfi_cross_dso_test_exe") {
71  sanitize = {
72    cfi = true
73    cfi_cross_dso = true
74    debug = true
75  }
76  subsystem_name = "musl"
77  part_name = "libc-test"
78  include_dirs = [
79    "../common",
80    "//third_party/musl/porting/linux/user/include",
81    "//third_party/musl/porting/linux/user/ldso",
82    "//third_party/musl/libc-test/src/common",
83  ]
84  use_rtti = true
85
86  sources = [ "./crossdso/cfi_test_exe.cpp" ]
87  configs = [ "//third_party/musl/libc-test/src/common:config_runtest" ]
88}
89
90ohos_executable("cfi_avaiable_schemes_test") {
91  sanitize = {
92    cfi = true
93    cfi_cross_dso = true
94    debug = true
95  }
96  subsystem_name = "musl"
97  part_name = "libc-test"
98  include_dirs = [
99    "../common",
100    "//third_party/musl/porting/linux/user/include",
101    "//third_party/musl/porting/linux/user/ldso",
102    "//third_party/musl/libc-test/src/common",
103  ]
104  use_rtti = true
105
106  sources = [ "cfi_avaiable_schemes_test.cpp" ]
107  configs = [ "//third_party/musl/libc-test/src/common:config_runtest" ]
108}
109