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

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

Issue 2560423004: Build and package LLD unconditionally with the bundled Clang (Closed)
Patch Set: Created 4 years 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 'lib/clang/*/cfi_blacklist.txt', 200 'lib/clang/*/cfi_blacklist.txt',
201 # Copy built-in headers (lib/clang/3.x.y/include). 201 # Copy built-in headers (lib/clang/3.x.y/include).
202 'lib/clang/*/include/*', 202 'lib/clang/*/include/*',
203 ] 203 ]
204 if sys.platform == 'win32': 204 if sys.platform == 'win32':
205 want.append('bin/clang-cl.exe') 205 want.append('bin/clang-cl.exe')
206 want.append('bin/lld-link.exe') 206 want.append('bin/lld-link.exe')
207 else: 207 else:
208 so_ext = 'dylib' if sys.platform == 'darwin' else 'so' 208 so_ext = 'dylib' if sys.platform == 'darwin' else 'so'
209 want.extend(['bin/clang', 209 want.extend(['bin/clang',
210 'bin/lld',
210 'lib/libFindBadConstructs.' + so_ext, 211 'lib/libFindBadConstructs.' + so_ext,
211 'lib/libBlinkGCPlugin.' + so_ext, 212 'lib/libBlinkGCPlugin.' + so_ext,
212 ]) 213 ])
213 if sys.platform == 'darwin': 214 if sys.platform == 'darwin':
214 want.extend([# Copy only the OSX and iossim (ASan and profile) runtime 215 want.extend([# Copy only the OSX and iossim (ASan and profile) runtime
215 # libraries: 216 # libraries:
216 'lib/clang/*/lib/darwin/*asan_osx*', 217 'lib/clang/*/lib/darwin/*asan_osx*',
217 'lib/clang/*/lib/darwin/*asan_iossim*', 218 'lib/clang/*/lib/darwin/*asan_iossim*',
218 'lib/clang/*/lib/darwin/*profile_osx*', 219 'lib/clang/*/lib/darwin/*profile_osx*',
219 'lib/clang/*/lib/darwin/*profile_iossim*', 220 'lib/clang/*/lib/darwin/*profile_iossim*',
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 if sys.platform == 'darwin' and f.endswith('.dylib'): 254 if sys.platform == 'darwin' and f.endswith('.dylib'):
254 subprocess.call(['strip', '-x', dest]) 255 subprocess.call(['strip', '-x', dest])
255 elif (sys.platform.startswith('linux') and 256 elif (sys.platform.startswith('linux') and
256 os.path.splitext(f)[1] in ['.so', '.a']): 257 os.path.splitext(f)[1] in ['.so', '.a']):
257 subprocess.call(['strip', '-g', dest]) 258 subprocess.call(['strip', '-g', dest])
258 259
259 # Set up symlinks. 260 # Set up symlinks.
260 if sys.platform != 'win32': 261 if sys.platform != 'win32':
261 os.symlink('clang', os.path.join(pdir, 'bin', 'clang++')) 262 os.symlink('clang', os.path.join(pdir, 'bin', 'clang++'))
262 os.symlink('clang', os.path.join(pdir, 'bin', 'clang-cl')) 263 os.symlink('clang', os.path.join(pdir, 'bin', 'clang-cl'))
264 os.symlink('lld', os.path.join(pdir, 'bin', 'ld.lld'))
263 265
264 # Copy libc++ headers. 266 # Copy libc++ headers.
265 if sys.platform == 'darwin': 267 if sys.platform == 'darwin':
266 shutil.copytree(os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'include', 'c++'), 268 shutil.copytree(os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'include', 'c++'),
267 os.path.join(pdir, 'include', 'c++')) 269 os.path.join(pdir, 'include', 'c++'))
268 270
269 # Copy buildlog over. 271 # Copy buildlog over.
270 shutil.copy('buildlog.txt', pdir) 272 shutil.copy('buildlog.txt', pdir)
271 273
272 # Create archive. 274 # Create archive.
(...skipping 26 matching lines...) Expand all
299 with tarfile.open(objdumpdir + '.tgz', 'w:gz') as tar: 301 with tarfile.open(objdumpdir + '.tgz', 'w:gz') as tar:
300 tar.add(os.path.join(objdumpdir, 'bin'), arcname='bin', 302 tar.add(os.path.join(objdumpdir, 'bin'), arcname='bin',
301 filter=PrintTarProgress) 303 filter=PrintTarProgress)
302 MaybeUpload(args, objdumpdir, platform) 304 MaybeUpload(args, objdumpdir, platform)
303 305
304 # FIXME: Warn if the file already exists on the server. 306 # FIXME: Warn if the file already exists on the server.
305 307
306 308
307 if __name__ == '__main__': 309 if __name__ == '__main__':
308 sys.exit(main()) 310 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