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 { | 5 { |
6 'variables': { | 6 'variables': { |
7 'target_define%': 'TARGET_UNSUPPORTED', | 7 'target_define%': 'TARGET_UNSUPPORTED', |
8 'conditions': [ | 8 'conditions': [ |
9 [ 'target_arch == "arm"', { | 9 [ 'target_arch == "arm"', { |
10 'target_define': 'TARGET_ARM', | 10 'target_define': 'TARGET_ARM', |
11 }], | 11 }], |
12 [ 'target_arch == "arm64"', { | 12 [ 'target_arch == "arm64"', { |
13 'target_define': 'TARGET_ARM64', | 13 'target_define': 'TARGET_ARM64', |
14 }], | 14 }], |
15 ], | 15 ], |
16 }, | 16 }, |
17 'targets': [ | 17 'targets': [ |
18 { | 18 { |
19 'target_name': 'lib_relocation_packer', | 19 'target_name': 'lib_relocation_packer', |
20 'toolsets': ['host'], | 20 'toolsets': ['host'], |
21 'type': 'static_library', | 21 'type': 'static_library', |
22 'defines': [ | 22 'defines': [ |
23 '<(target_define)', | 23 '<(target_define)', |
24 ], | 24 ], |
25 'dependencies': [ | 25 'dependencies': [ |
26 '../../third_party/elfutils/elfutils.gyp:libelf', | 26 '../../third_party/elfutils/elfutils.gyp:libelf', |
27 ], | 27 ], |
28 'sources': [ | 28 'sources': [ |
29 'src/debug.cc', | 29 'src/debug.cc', |
| 30 'src/delta_encoder.cc', |
30 'src/elf_file.cc', | 31 'src/elf_file.cc', |
31 'src/leb128.cc', | 32 'src/leb128.cc', |
32 'src/packer.cc', | 33 'src/packer.cc', |
| 34 'src/sleb128.cc', |
33 'src/run_length_encoder.cc', | 35 'src/run_length_encoder.cc', |
34 ], | 36 ], |
35 }, | 37 }, |
36 { | 38 { |
37 'target_name': 'relocation_packer', | 39 'target_name': 'relocation_packer', |
38 'toolsets': ['host'], | 40 'toolsets': ['host'], |
39 'type': 'executable', | 41 'type': 'executable', |
40 'defines': [ | 42 'defines': [ |
41 '<(target_define)', | 43 '<(target_define)', |
42 ], | 44 ], |
(...skipping 17 matching lines...) Expand all Loading... |
60 ], | 62 ], |
61 'dependencies': [ | 63 'dependencies': [ |
62 '../../testing/gtest.gyp:gtest', | 64 '../../testing/gtest.gyp:gtest', |
63 'lib_relocation_packer', | 65 'lib_relocation_packer', |
64 ], | 66 ], |
65 'include_dirs': [ | 67 'include_dirs': [ |
66 '../..', | 68 '../..', |
67 ], | 69 ], |
68 'sources': [ | 70 'sources': [ |
69 'src/debug_unittest.cc', | 71 'src/debug_unittest.cc', |
| 72 'src/delta_encoder_unittest.cc', |
70 'src/elf_file_unittest.cc', | 73 'src/elf_file_unittest.cc', |
71 'src/leb128_unittest.cc', | 74 'src/leb128_unittest.cc', |
72 'src/packer_unittest.cc', | 75 'src/packer_unittest.cc', |
| 76 'src/sleb128_unittest.cc', |
73 'src/run_length_encoder_unittest.cc', | 77 'src/run_length_encoder_unittest.cc', |
74 'src/run_all_unittests.cc', | 78 'src/run_all_unittests.cc', |
75 ], | 79 ], |
76 'copies': [ | 80 'copies': [ |
77 { | 81 { |
78 'destination': '<(INTERMEDIATE_DIR)', | 82 'destination': '<(INTERMEDIATE_DIR)', |
79 'files': [ | 83 'files': [ |
80 'test_data/elf_file_unittest_relocs.so', | 84 'test_data/elf_file_unittest_relocs_arm32.so', |
81 'test_data/elf_file_unittest_relocs_packed.so', | 85 'test_data/elf_file_unittest_relocs_arm32_packed.so', |
| 86 'test_data/elf_file_unittest_relocs_arm64.so', |
| 87 'test_data/elf_file_unittest_relocs_arm64_packed.so', |
82 ], | 88 ], |
83 }, | 89 }, |
84 ], | 90 ], |
| 91 }, |
| 92 |
| 93 # Targets to build test data. These participate only in building test |
| 94 # data for use with elf_file_unittest.cc, and are not part of the main |
| 95 # relocation packer build. Unit test data files are checked in to the |
| 96 # source tree as 'golden' data, and are not generated 'on the fly' by |
| 97 # the build. |
| 98 # |
| 99 # See test_data/generate_elf_file_unittest_relocs.sh for instructions. |
| 100 { |
| 101 'target_name': 'relocation_packer_test_data', |
| 102 'toolsets': ['target'], |
| 103 'type': 'shared_library', |
| 104 'cflags': [ |
| 105 '-O0', |
| 106 '-g0', |
| 107 ], |
| 108 'sources': [ |
| 109 'test_data/elf_file_unittest_relocs.cc', |
| 110 ], |
| 111 }, |
| 112 { |
| 113 'target_name': 'relocation_packer_unittests_test_data', |
| 114 'toolsets': ['target'], |
| 115 'type': 'none', |
| 116 'actions': [ |
| 117 { |
| 118 'variables': { |
| 119 'test_file': '<(SHARED_LIB_DIR)/librelocation_packer_test_data.so', |
| 120 'conditions': [ |
| 121 [ 'target_arch == "arm"', { |
| 122 'added_section': '.android.rel.dyn', |
| 123 'unpacked_output': 'elf_file_unittest_relocs_arm32.so', |
| 124 'packed_output': 'elf_file_unittest_relocs_arm32_packed.so', |
| 125 }], |
| 126 [ 'target_arch == "arm64"', { |
| 127 'added_section': '.android.rela.dyn', |
| 128 'unpacked_output': 'elf_file_unittest_relocs_arm64.so', |
| 129 'packed_output': 'elf_file_unittest_relocs_arm64_packed.so', |
| 130 }], |
| 131 ], |
| 132 }, |
| 133 'action_name': 'generate_relocation_packer_test_data', |
| 134 'inputs': [ |
| 135 'test_data/generate_elf_file_unittest_relocs.py', |
| 136 '<(PRODUCT_DIR)/relocation_packer', |
| 137 '<(test_file)', |
| 138 ], |
| 139 'outputs': [ |
| 140 '<(INTERMEDIATE_DIR)/<(unpacked_output)', |
| 141 '<(INTERMEDIATE_DIR)/<(packed_output)', |
| 142 ], |
| 143 'action': [ |
| 144 'python', 'test_data/generate_elf_file_unittest_relocs.py', |
| 145 '--android-pack-relocations=<(PRODUCT_DIR)/relocation_packer', |
| 146 '--android-objcopy=<(android_objcopy)', |
| 147 '--added-section=<(added_section)', |
| 148 '--test-file=<(test_file)', |
| 149 '--unpacked-output=<(INTERMEDIATE_DIR)/<(unpacked_output)', |
| 150 '--packed-output=<(INTERMEDIATE_DIR)/<(packed_output)', |
| 151 ], |
| 152 }, |
| 153 ], |
85 }, | 154 }, |
86 ], | 155 ], |
87 } | 156 } |
OLD | NEW |