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

Side by Side Diff: tools/clang/scripts/package.py

Issue 2158753003: Clang toolchain: use lld to compile LLVM Gold plugin and lld with LTO. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copy lld into the Linux archive. Created 4 years, 5 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 | tools/clang/scripts/update.py » ('j') | tools/clang/scripts/update.py » ('J')
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 # Copyright (c) 2015 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """This script will check out llvm and clang, and then package the results up 6 """This script will check out llvm and clang, and then package the results up
7 to a tgz file.""" 7 to a tgz file."""
8 8
9 import argparse 9 import argparse
10 import fnmatch 10 import fnmatch
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 Tee('Starting build\n', log) 172 Tee('Starting build\n', log)
173 173
174 # Do a clobber build. 174 # Do a clobber build.
175 shutil.rmtree(LLVM_BOOTSTRAP_DIR, ignore_errors=True) 175 shutil.rmtree(LLVM_BOOTSTRAP_DIR, ignore_errors=True)
176 shutil.rmtree(LLVM_BOOTSTRAP_INSTALL_DIR, ignore_errors=True) 176 shutil.rmtree(LLVM_BOOTSTRAP_INSTALL_DIR, ignore_errors=True)
177 shutil.rmtree(LLVM_BUILD_DIR, ignore_errors=True) 177 shutil.rmtree(LLVM_BUILD_DIR, ignore_errors=True)
178 178
179 opt_flags = [] 179 opt_flags = []
180 if sys.platform.startswith('linux'): 180 if sys.platform.startswith('linux'):
181 opt_flags += ['--lto-gold-plugin'] 181 opt_flags += ['--lto']
182 build_cmd = [sys.executable, os.path.join(THIS_DIR, 'update.py'), 182 build_cmd = [sys.executable, os.path.join(THIS_DIR, 'update.py'),
183 '--bootstrap', '--force-local-build', 183 '--bootstrap', '--force-local-build',
184 '--run-tests'] + opt_flags 184 '--run-tests'] + opt_flags
185 TeeCmd(build_cmd, log) 185 TeeCmd(build_cmd, log)
186 186
187 stamp = open(STAMP_FILE).read().rstrip() 187 stamp = open(STAMP_FILE).read().rstrip()
188 if stamp != expected_stamp: 188 if stamp != expected_stamp:
189 print 'Actual stamp (%s) != expected stamp (%s).' % (stamp, expected_stamp) 189 print 'Actual stamp (%s) != expected stamp (%s).' % (stamp, expected_stamp)
190 return 1 190 return 1
191 191
(...skipping 18 matching lines...) Expand all
210 'lib/libBlinkGCPlugin.' + so_ext, 210 'lib/libBlinkGCPlugin.' + so_ext,
211 ]) 211 ])
212 if sys.platform == 'darwin': 212 if sys.platform == 'darwin':
213 want.extend([# Copy only the OSX (ASan and profile) and iossim (ASan) 213 want.extend([# Copy only the OSX (ASan and profile) and iossim (ASan)
214 # runtime libraries: 214 # runtime libraries:
215 'lib/clang/*/lib/darwin/*asan_osx*', 215 'lib/clang/*/lib/darwin/*asan_osx*',
216 'lib/clang/*/lib/darwin/*asan_iossim*', 216 'lib/clang/*/lib/darwin/*asan_iossim*',
217 'lib/clang/*/lib/darwin/*profile_osx*', 217 'lib/clang/*/lib/darwin/*profile_osx*',
218 ]) 218 ])
219 elif sys.platform.startswith('linux'): 219 elif sys.platform.startswith('linux'):
220 want.append('bin/lld')
220 # Copy the libstdc++.so.6 we linked Clang against so it can run. 221 # Copy the libstdc++.so.6 we linked Clang against so it can run.
221 want.append('lib/libstdc++.so.6') 222 want.append('lib/libstdc++.so.6')
222 # Copy only 223 # Copy only
223 # lib/clang/*/lib/linux/libclang_rt.{[atm]san,san,ubsan,profile}-*.a , 224 # lib/clang/*/lib/linux/libclang_rt.{[atm]san,san,ubsan,profile}-*.a ,
224 # but not dfsan. 225 # but not dfsan.
225 want.extend(['lib/clang/*/lib/linux/*[atm]san*', 226 want.extend(['lib/clang/*/lib/linux/*[atm]san*',
226 'lib/clang/*/lib/linux/*ubsan*', 227 'lib/clang/*/lib/linux/*ubsan*',
227 'lib/clang/*/lib/linux/*libclang_rt.san*', 228 'lib/clang/*/lib/linux/*libclang_rt.san*',
228 'lib/clang/*/lib/linux/*profile*', 229 'lib/clang/*/lib/linux/*profile*',
229 'lib/clang/*/msan_blacklist.txt', 230 'lib/clang/*/msan_blacklist.txt',
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 with tarfile.open(objdumpdir + '.tgz', 'w:gz') as tar: 298 with tarfile.open(objdumpdir + '.tgz', 'w:gz') as tar:
298 tar.add(os.path.join(objdumpdir, 'bin'), arcname='bin', 299 tar.add(os.path.join(objdumpdir, 'bin'), arcname='bin',
299 filter=PrintTarProgress) 300 filter=PrintTarProgress)
300 MaybeUpload(args, objdumpdir, platform) 301 MaybeUpload(args, objdumpdir, platform)
301 302
302 # FIXME: Warn if the file already exists on the server. 303 # FIXME: Warn if the file already exists on the server.
303 304
304 305
305 if __name__ == '__main__': 306 if __name__ == '__main__':
306 sys.exit(main()) 307 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | tools/clang/scripts/update.py » ('j') | tools/clang/scripts/update.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698