OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("config.gni") | 5 import("config.gni") |
6 import("//testing/test.gni") | 6 import("//testing/test.gni") |
7 | 7 |
8 assert(relocation_packing_supported) | 8 assert(relocation_packing_supported) |
9 | 9 |
10 if (target_arch == "arm") { | 10 if (target_cpu == "arm") { |
11 target_define = "TARGET_ARM" | 11 target_define = "TARGET_ARM" |
12 } else if (target_arch == "arm64") { | 12 } else if (target_cpu == "arm64") { |
13 target_define = "TARGET_ARM64" | 13 target_define = "TARGET_ARM64" |
14 } | 14 } |
15 | 15 |
16 if (current_toolchain == host_toolchain) { | 16 if (current_toolchain == host_toolchain) { |
17 # GYP: //tools/relocation_packer/relocation_packer.gyp:lib_relocation_packer | 17 # GYP: //tools/relocation_packer/relocation_packer.gyp:lib_relocation_packer |
18 source_set("lib_relocation_packer") { | 18 source_set("lib_relocation_packer") { |
19 defines = [ target_define ] | 19 defines = [ target_define ] |
20 deps = [ | 20 deps = [ |
21 "//third_party/elfutils:libelf", | 21 "//third_party/elfutils:libelf", |
22 ] | 22 ] |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 include_dirs = [ "//" ] | 71 include_dirs = [ "//" ] |
72 deps = [ | 72 deps = [ |
73 ":lib_relocation_packer", | 73 ":lib_relocation_packer", |
74 ":relocation_packer_test_data", | 74 ":relocation_packer_test_data", |
75 "//testing:gtest", | 75 "//testing:gtest", |
76 ] | 76 ] |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 if (current_toolchain == default_toolchain && | 80 if (current_toolchain == default_toolchain && |
81 (target_arch == "arm" || target_arch == "arm64")) { | 81 (target_cpu == "arm" || target_cpu == "arm64")) { |
82 # Targets to build test data. These participate only in building test | 82 # Targets to build test data. These participate only in building test |
83 # data for use with elf_file_unittest.cc, and are not part of the main | 83 # data for use with elf_file_unittest.cc, and are not part of the main |
84 # relocation packer build. Unit test data files are checked in to the | 84 # relocation packer build. Unit test data files are checked in to the |
85 # source tree as 'golden' data, and are not generated 'on the fly' by | 85 # source tree as 'golden' data, and are not generated 'on the fly' by |
86 # the build. | 86 # the build. |
87 # | 87 # |
88 # See test_data/generate_elf_file_unittest_relocs.sh for instructions. | 88 # See test_data/generate_elf_file_unittest_relocs.sh for instructions. |
89 | 89 |
90 # GYP: //tools/relocation_packer/relocation_packer.gyp:relocation_packer_test_
data | 90 # GYP: //tools/relocation_packer/relocation_packer.gyp:relocation_packer_test_
data |
91 shared_library("relocation_packer_test_data") { | 91 shared_library("relocation_packer_test_data") { |
92 cflags = [ | 92 cflags = [ |
93 "-O0", | 93 "-O0", |
94 "-g0", | 94 "-g0", |
95 ] | 95 ] |
96 sources = [ | 96 sources = [ |
97 "test_data/elf_file_unittest_relocs.cc", | 97 "test_data/elf_file_unittest_relocs.cc", |
98 ] | 98 ] |
99 } | 99 } |
100 | 100 |
101 # GYP: //tools/relocation_packer/relocation_packer.gyp:relocation_packer_unitt
ests_test_data | 101 # GYP: //tools/relocation_packer/relocation_packer.gyp:relocation_packer_unitt
ests_test_data |
102 action("relocation_packer_unittests_test_data") { | 102 action("relocation_packer_unittests_test_data") { |
103 script = "test_data/generate_elf_file_unittest_relocs.py" | 103 script = "test_data/generate_elf_file_unittest_relocs.py" |
104 test_file = "$root_build_dir/librelocation_packer_test_data.so" | 104 test_file = "$root_build_dir/librelocation_packer_test_data.so" |
105 if (target_arch == "arm") { | 105 if (target_cpu == "arm") { |
106 added_section = ".android.rel.dyn" | 106 added_section = ".android.rel.dyn" |
107 packed_output = "elf_file_unittest_relocs_arm32_packed.so" | 107 packed_output = "elf_file_unittest_relocs_arm32_packed.so" |
108 unpacked_output = "elf_file_unittest_relocs_arm32.so" | 108 unpacked_output = "elf_file_unittest_relocs_arm32.so" |
109 } else if (target_arch == "arm64") { | 109 } else if (target_cpu == "arm64") { |
110 added_section = ".android.rela.dyn" | 110 added_section = ".android.rela.dyn" |
111 packed_output = "elf_file_unittest_relocs_arm64_packed.so" | 111 packed_output = "elf_file_unittest_relocs_arm64_packed.so" |
112 unpacked_output = "elf_file_unittest_relocs_arm64.so" | 112 unpacked_output = "elf_file_unittest_relocs_arm64.so" |
113 } else { | 113 } else { |
114 assert(false, "Unsupported target arch for relocation packer") | 114 assert(false, "Unsupported target arch for relocation packer") |
115 } | 115 } |
116 | 116 |
117 packed_output = "$root_build_dir/$packed_output" | 117 packed_output = "$root_build_dir/$packed_output" |
118 unpacked_output = "$root_build_dir/$unpacked_output" | 118 unpacked_output = "$root_build_dir/$unpacked_output" |
119 | 119 |
(...skipping 19 matching lines...) Expand all Loading... |
139 "--added-section=$added_section", | 139 "--added-section=$added_section", |
140 "--test-file", | 140 "--test-file", |
141 rebase_path(test_file, root_build_dir), | 141 rebase_path(test_file, root_build_dir), |
142 "--packed-output", | 142 "--packed-output", |
143 rebase_path(packed_output, root_build_dir), | 143 rebase_path(packed_output, root_build_dir), |
144 "--unpacked-output", | 144 "--unpacked-output", |
145 rebase_path(unpacked_output, root_build_dir), | 145 rebase_path(unpacked_output, root_build_dir), |
146 ] | 146 ] |
147 } | 147 } |
148 } | 148 } |
OLD | NEW |