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

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

Issue 2572833003: Clang toolchain: checkout LLD on all platforms but Darwin. (Closed)
Patch Set: Add llvm-ar and lld into the distribution Created 3 years, 10 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') | 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 # 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 want.extend([# Copy only the OSX and iossim (ASan and profile) runtime 214 want.extend([# Copy only the OSX and iossim (ASan and profile) runtime
215 # libraries: 215 # libraries:
216 'lib/clang/*/lib/darwin/*asan_osx*', 216 'lib/clang/*/lib/darwin/*asan_osx*',
217 'lib/clang/*/lib/darwin/*asan_iossim*', 217 'lib/clang/*/lib/darwin/*asan_iossim*',
218 'lib/clang/*/lib/darwin/*profile_osx*', 218 'lib/clang/*/lib/darwin/*profile_osx*',
219 'lib/clang/*/lib/darwin/*profile_iossim*', 219 'lib/clang/*/lib/darwin/*profile_iossim*',
220 ]) 220 ])
221 elif sys.platform.startswith('linux'): 221 elif sys.platform.startswith('linux'):
222 # Copy the libstdc++.so.6 we linked Clang against so it can run. 222 # Copy the libstdc++.so.6 we linked Clang against so it can run.
223 want.append('lib/libstdc++.so.6') 223 want.append('lib/libstdc++.so.6')
224 # Add llvm-ar and lld for LTO.
225 want.append('bin/llvm-ar')
Nico 2017/02/08 20:02:00 do we need this? on windows we run `lld-link /lib`
krasin1 2017/02/08 20:36:41 yes, we do. Right now, when we do an LTO build, ar
226 want.append('bin/lld')
224 # Copy only 227 # Copy only
225 # lib/clang/*/lib/linux/libclang_rt.{[atm]san,san,ubsan,profile}-*.a , 228 # lib/clang/*/lib/linux/libclang_rt.{[atm]san,san,ubsan,profile}-*.a ,
226 # but not dfsan. 229 # but not dfsan.
227 want.extend(['lib/clang/*/lib/linux/*[atm]san*', 230 want.extend(['lib/clang/*/lib/linux/*[atm]san*',
228 'lib/clang/*/lib/linux/*ubsan*', 231 'lib/clang/*/lib/linux/*ubsan*',
229 'lib/clang/*/lib/linux/*libclang_rt.san*', 232 'lib/clang/*/lib/linux/*libclang_rt.san*',
230 'lib/clang/*/lib/linux/*profile*', 233 'lib/clang/*/lib/linux/*profile*',
231 'lib/clang/*/msan_blacklist.txt', 234 'lib/clang/*/msan_blacklist.txt',
232 ]) 235 ])
233 elif sys.platform == 'win32': 236 elif sys.platform == 'win32':
(...skipping 20 matching lines...) Expand all
254 subprocess.call(['strip', '-x', dest]) 257 subprocess.call(['strip', '-x', dest])
255 elif (sys.platform.startswith('linux') and 258 elif (sys.platform.startswith('linux') and
256 os.path.splitext(f)[1] in ['.so', '.a']): 259 os.path.splitext(f)[1] in ['.so', '.a']):
257 subprocess.call(['strip', '-g', dest]) 260 subprocess.call(['strip', '-g', dest])
258 261
259 # Set up symlinks. 262 # Set up symlinks.
260 if sys.platform != 'win32': 263 if sys.platform != 'win32':
261 os.symlink('clang', os.path.join(pdir, 'bin', 'clang++')) 264 os.symlink('clang', os.path.join(pdir, 'bin', 'clang++'))
262 os.symlink('clang', os.path.join(pdir, 'bin', 'clang-cl')) 265 os.symlink('clang', os.path.join(pdir, 'bin', 'clang-cl'))
263 266
267 if sys.platform.startswith('linux'):
268 os.symlink('lld', os.path.join(pdir, 'bin', 'ld.lld'))
269
264 # Copy libc++ headers. 270 # Copy libc++ headers.
265 if sys.platform == 'darwin': 271 if sys.platform == 'darwin':
266 shutil.copytree(os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'include', 'c++'), 272 shutil.copytree(os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'include', 'c++'),
267 os.path.join(pdir, 'include', 'c++')) 273 os.path.join(pdir, 'include', 'c++'))
268 274
269 # Copy buildlog over. 275 # Copy buildlog over.
270 shutil.copy('buildlog.txt', pdir) 276 shutil.copy('buildlog.txt', pdir)
271 277
272 # Create archive. 278 # Create archive.
273 tar_entries = ['bin', 'lib', 'buildlog.txt'] 279 tar_entries = ['bin', 'lib', 'buildlog.txt']
(...skipping 25 matching lines...) Expand all
299 with tarfile.open(objdumpdir + '.tgz', 'w:gz') as tar: 305 with tarfile.open(objdumpdir + '.tgz', 'w:gz') as tar:
300 tar.add(os.path.join(objdumpdir, 'bin'), arcname='bin', 306 tar.add(os.path.join(objdumpdir, 'bin'), arcname='bin',
301 filter=PrintTarProgress) 307 filter=PrintTarProgress)
302 MaybeUpload(args, objdumpdir, platform) 308 MaybeUpload(args, objdumpdir, platform)
303 309
304 # FIXME: Warn if the file already exists on the server. 310 # FIXME: Warn if the file already exists on the server.
305 311
306 312
307 if __name__ == '__main__': 313 if __name__ == '__main__':
308 sys.exit(main()) 314 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | tools/clang/scripts/update.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698