• 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_same_symbol_name_with_different_version") {
17  testonly = true
18  deps = [
19    ":ldso_reloc_diff_version_A",
20    ":ldso_reloc_diff_version_B",
21    ":ldso_reloc_diff_version_exe",
22  ]
23}
24
25ohos_shared_library("ldso_reloc_diff_version_A") {
26  include_dirs = [ "." ]
27
28  sources = [ "ldso_relocation_diff_version_test_Aso.c" ]
29
30  output_name = "ldso_relocation_diff_version_test_Aso"
31
32  output_extension = "so"
33
34  cflags = [ "-fPIC" ]
35
36  ldflags = [
37    "-shared",
38    "-Wl,-rpath=./:/data/local/tmp/libc-test-lib/",
39  ]
40
41  version_script = "A.map.txt"
42
43  subsystem_name = "musl"
44  part_name = "libc-test-lib"
45}
46
47ohos_shared_library("ldso_reloc_diff_version_B") {
48  include_dirs = [ "." ]
49
50  sources = [
51    "ldso_relocation_diff_version_test_Bso.c",
52    "ldso_relocation_diff_version_test_Bso_2.c",
53  ]
54
55  output_name = "ldso_relocation_diff_version_test_Bso"
56
57  output_extension = "so"
58
59  cflags = [ "-fPIC" ]
60
61  ldflags = [
62    "-shared",
63    "-Wl,-rpath=./:/data/local/tmp/libc-test-lib/",
64  ]
65
66  version_script = "B.map.txt"
67
68  subsystem_name = "musl"
69  part_name = "libc-test-lib"
70}
71
72ohos_shared_library("ldso_reloc_diff_version_C") {
73  include_dirs = [ "." ]
74
75  sources = [ "ldso_relocation_diff_version_test_Cso.c" ]
76
77  output_name = "ldso_relocation_diff_version_test_Cso"
78
79  output_extension = "so"
80
81  cflags = [ "-fPIC" ]
82
83  deps = [
84    ":ldso_reloc_diff_version_A",
85    ":ldso_reloc_diff_version_B",
86  ]
87
88  ldflags = [
89    "-shared",
90    "-Wl,-rpath=./:/data/local/tmp/libc-test-lib/",
91    "-Lmusl/libc-test-lib",
92    "-lldso_relocation_diff_version_test_Aso",
93  ]
94
95  version_script = "B.map.txt"
96
97  subsystem_name = "musl"
98  part_name = "libc-test-lib"
99}
100
101ohos_executable("ldso_reloc_diff_version_exe") {
102  sources = [ "ldso_relocation_diff_version_test.c" ]
103  testonly = true
104  deps = [ ":ldso_reloc_diff_version_C" ]
105  include_dirs = [
106    "../common",
107    "//third_party/musl/libc-test/src/common",
108  ]
109  ldflags = [ "-Wl,-rpath=./:/data/local/tmp/libc-test-lib/" ]
110  configs = [ "//third_party/musl/libc-test/src/common:config_runtest" ]
111  subsystem_name = "musl"
112  part_name = "libc-test"
113}
114