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
3 # found in the LICENSE file.
7 'target_define%': 'TARGET_UNSUPPORTED',
9 [ 'target_arch == "arm"', {
10 'target_define': 'TARGET_ARM',
12 [ 'target_arch == "arm64"', {
13 'target_define': 'TARGET_ARM64',
19 # GN: //tools/relocation_packer:lib_relocation_packer
20 'target_name': 'lib_relocation_packer',
22 'type': 'static_library',
27 '../../third_party/elfutils/elfutils.gyp:libelf',
31 'src/delta_encoder.cc',
36 'src/run_length_encoder.cc',
40 # GN: //tools/relocation_packer:relocation_packer
41 'target_name': 'relocation_packer',
48 '../../third_party/elfutils/elfutils.gyp:libelf',
49 'lib_relocation_packer',
56 # GN: //tools/relocation_packer:relocation_packer_unittests
57 'target_name': 'relocation_packer_unittests',
64 '-DINTERMEDIATE_DIR="<(INTERMEDIATE_DIR)"',
67 '../../testing/gtest.gyp:gtest',
68 'lib_relocation_packer',
74 'src/debug_unittest.cc',
75 'src/delta_encoder_unittest.cc',
76 'src/elf_file_unittest.cc',
77 'src/leb128_unittest.cc',
78 'src/packer_unittest.cc',
79 'src/sleb128_unittest.cc',
80 'src/run_length_encoder_unittest.cc',
81 'src/run_all_unittests.cc',
85 'destination': '<(INTERMEDIATE_DIR)',
87 'test_data/elf_file_unittest_relocs_arm32.so',
88 'test_data/elf_file_unittest_relocs_arm32_packed.so',
89 'test_data/elf_file_unittest_relocs_arm64.so',
90 'test_data/elf_file_unittest_relocs_arm64_packed.so',
96 # Targets to build test data. These participate only in building test
97 # data for use with elf_file_unittest.cc, and are not part of the main
98 # relocation packer build. Unit test data files are checked in to the
99 # source tree as 'golden' data, and are not generated 'on the fly' by
102 # See test_data/generate_elf_file_unittest_relocs.sh for instructions.
104 # GN: //tools/relocation_packer:relocation_packer_test_data
105 'target_name': 'relocation_packer_test_data',
106 'toolsets': ['target'],
107 'type': 'shared_library',
113 'test_data/elf_file_unittest_relocs.cc',
117 # GN: //tools/relocation_packer:relocation_packer_unittests_test_data
118 'target_name': 'relocation_packer_unittests_test_data',
119 'toolsets': ['target'],
124 'test_file': '<(SHARED_LIB_DIR)/librelocation_packer_test_data.so',
126 [ 'target_arch == "arm"', {
127 'added_section': '.android.rel.dyn',
128 'unpacked_output': 'elf_file_unittest_relocs_arm32.so',
129 'packed_output': 'elf_file_unittest_relocs_arm32_packed.so',
131 [ 'target_arch == "arm64"', {
132 'added_section': '.android.rela.dyn',
133 'unpacked_output': 'elf_file_unittest_relocs_arm64.so',
134 'packed_output': 'elf_file_unittest_relocs_arm64_packed.so',
138 'action_name': 'generate_relocation_packer_test_data',
140 'test_data/generate_elf_file_unittest_relocs.py',
141 '<(PRODUCT_DIR)/relocation_packer',
145 '<(INTERMEDIATE_DIR)/<(unpacked_output)',
146 '<(INTERMEDIATE_DIR)/<(packed_output)',
149 'python', 'test_data/generate_elf_file_unittest_relocs.py',
150 '--android-pack-relocations=<(PRODUCT_DIR)/relocation_packer',
151 '--android-objcopy=<(android_objcopy)',
152 '--added-section=<(added_section)',
153 '--test-file=<(test_file)',
154 '--unpacked-output=<(INTERMEDIATE_DIR)/<(unpacked_output)',
155 '--packed-output=<(INTERMEDIATE_DIR)/<(packed_output)',