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 'target_name': 'lib_relocation_packer',
21 'type': 'static_library',
26 '../../third_party/elfutils/elfutils.gyp:libelf',
30 'src/delta_encoder.cc',
35 'src/run_length_encoder.cc',
39 'target_name': 'relocation_packer',
46 '../../third_party/elfutils/elfutils.gyp:libelf',
47 'lib_relocation_packer',
54 'target_name': 'relocation_packer_unittests',
61 '-DINTERMEDIATE_DIR="<(INTERMEDIATE_DIR)"',
64 '../../testing/gtest.gyp:gtest',
65 'lib_relocation_packer',
71 'src/debug_unittest.cc',
72 'src/delta_encoder_unittest.cc',
73 'src/elf_file_unittest.cc',
74 'src/leb128_unittest.cc',
75 'src/packer_unittest.cc',
76 'src/sleb128_unittest.cc',
77 'src/run_length_encoder_unittest.cc',
78 'src/run_all_unittests.cc',
82 'destination': '<(INTERMEDIATE_DIR)',
84 'test_data/elf_file_unittest_relocs_arm32.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',
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
99 # See test_data/generate_elf_file_unittest_relocs.sh for instructions.
101 'target_name': 'relocation_packer_test_data',
102 'toolsets': ['target'],
103 'type': 'shared_library',
109 'test_data/elf_file_unittest_relocs.cc',
113 'target_name': 'relocation_packer_unittests_test_data',
114 'toolsets': ['target'],
119 'test_file': '<(SHARED_LIB_DIR)/librelocation_packer_test_data.so',
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',
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',
133 'action_name': 'generate_relocation_packer_test_data',
135 'test_data/generate_elf_file_unittest_relocs.py',
136 '<(PRODUCT_DIR)/relocation_packer',
140 '<(INTERMEDIATE_DIR)/<(unpacked_output)',
141 '<(INTERMEDIATE_DIR)/<(packed_output)',
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)',