Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: build/android/gyp/pack_arm_relocations.py

Issue 675263002: Fix relocation packing in GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-packed
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2014 The Chromium Authors. All rights reserved. 3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Pack ARM relative relocations in a library (or copy unchanged). 7 """Pack ARM relative relocations in a library (or copy unchanged).
8 8
9 If --enable-packing and --configuration-name=='Release', invoke the 9 If --enable-packing and --configuration-name=='Release', invoke the
10 relocation_packer tool to pack the .rel.dyn or .rela.dyn section in the given 10 relocation_packer tool to pack the .rel.dyn or .rela.dyn section in the given
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 default='', 82 default='',
83 help='Names of any libraries explicitly not packed') 83 help='Names of any libraries explicitly not packed')
84 parser.add_option('--android-pack-relocations', 84 parser.add_option('--android-pack-relocations',
85 help='Path to the ARM relocations packer binary') 85 help='Path to the ARM relocations packer binary')
86 parser.add_option('--android-objcopy', 86 parser.add_option('--android-objcopy',
87 help='Path to the toolchain\'s objcopy binary') 87 help='Path to the toolchain\'s objcopy binary')
88 parser.add_option('--stripped-libraries-dir', 88 parser.add_option('--stripped-libraries-dir',
89 help='Directory for stripped libraries') 89 help='Directory for stripped libraries')
90 parser.add_option('--packed-libraries-dir', 90 parser.add_option('--packed-libraries-dir',
91 help='Directory for packed libraries') 91 help='Directory for packed libraries')
92 parser.add_option('--libraries', 92 parser.add_option('--libraries', action='append',
93 help='List of libraries') 93 help='List of libraries')
94 parser.add_option('--stamp', help='Path to touch on success') 94 parser.add_option('--stamp', help='Path to touch on success')
95 95
96 options, _ = parser.parse_args(args) 96 options, _ = parser.parse_args(args)
97 enable_packing = (options.enable_packing == '1' and 97 enable_packing = (options.enable_packing == '1' and
98 options.configuration_name == 'Release') 98 options.configuration_name == 'Release')
99 has_relocations_with_addends = (options.has_relocations_with_addends == '1') 99 has_relocations_with_addends = (options.has_relocations_with_addends == '1')
100 exclude_packing_set = set(shlex.split(options.exclude_packing_list)) 100 exclude_packing_set = set(shlex.split(options.exclude_packing_list))
101 101
102 libraries = build_utils.ParseGypList(options.libraries) 102 libraries = []
103 for libs_arg in options.libraries:
104 libraries += build_utils.ParseGypList(libs_arg)
103 105
104 if options.clear_dir: 106 if options.clear_dir:
105 build_utils.DeleteDirectory(options.packed_libraries_dir) 107 build_utils.DeleteDirectory(options.packed_libraries_dir)
106 108
107 build_utils.MakeDirectory(options.packed_libraries_dir) 109 build_utils.MakeDirectory(options.packed_libraries_dir)
108 110
109 for library in libraries: 111 for library in libraries:
110 library_path = os.path.join(options.stripped_libraries_dir, library) 112 library_path = os.path.join(options.stripped_libraries_dir, library)
111 output_path = os.path.join( 113 output_path = os.path.join(
112 options.packed_libraries_dir, os.path.basename(library)) 114 options.packed_libraries_dir, os.path.basename(library))
(...skipping 13 matching lines...) Expand all
126 libraries + build_utils.GetPythonDependencies()) 128 libraries + build_utils.GetPythonDependencies())
127 129
128 if options.stamp: 130 if options.stamp:
129 build_utils.Touch(options.stamp) 131 build_utils.Touch(options.stamp)
130 132
131 return 0 133 return 0
132 134
133 135
134 if __name__ == '__main__': 136 if __name__ == '__main__':
135 sys.exit(main(sys.argv[1:])) 137 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698