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

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

Issue 2213743002: Clang update.py: enable debug info for ToT builds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 is used to download prebuilt clang binaries. 6 """This script is used to download prebuilt clang binaries.
7 7
8 It is also used by package.py to build the prebuilt clang binaries.""" 8 It is also used by package.py to build the prebuilt clang binaries."""
9 9
10 import argparse 10 import argparse
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 # compiler, etc.) find the .so. 463 # compiler, etc.) find the .so.
464 libstdcpp = subprocess.check_output( 464 libstdcpp = subprocess.check_output(
465 [cxx, '-print-file-name=libstdc++.so.6']).rstrip() 465 [cxx, '-print-file-name=libstdc++.so.6']).rstrip()
466 os.environ['LD_LIBRARY_PATH'] = os.path.dirname(libstdcpp) 466 os.environ['LD_LIBRARY_PATH'] = os.path.dirname(libstdcpp)
467 467
468 cflags = [] 468 cflags = []
469 cxxflags = [] 469 cxxflags = []
470 ldflags = [] 470 ldflags = []
471 471
472 base_cmake_args = ['-GNinja', 472 base_cmake_args = ['-GNinja',
473 '-DCMAKE_BUILD_TYPE=Release',
474 '-DLLVM_ENABLE_ASSERTIONS=ON', 473 '-DLLVM_ENABLE_ASSERTIONS=ON',
475 '-DLLVM_ENABLE_THREADS=OFF', 474 '-DLLVM_ENABLE_THREADS=OFF',
476 '-DLLVM_ENABLE_TIMESTAMPS=OFF', 475 '-DLLVM_ENABLE_TIMESTAMPS=OFF',
477 # Statically link MSVCRT to avoid DLL dependencies. 476 # Statically link MSVCRT to avoid DLL dependencies.
478 '-DLLVM_USE_CRT_RELEASE=MT', 477 '-DLLVM_USE_CRT_RELEASE=MT',
479 ] 478 ]
480 479
480 if use_head_revision:
481 # For ToT builds, which are used to catch compiler bugs early, enable debug
482 # info for better backtraces when crashing.
483 base_cmake_args += ['-DCMAKE_BUILD_TYPE=RelWithDebInfo']
484 else:
485 base_cmake_args += ['-DCMAKE_BUILD_TYPE=Release']
486
481 binutils_incdir = '' 487 binutils_incdir = ''
482 if sys.platform.startswith('linux'): 488 if sys.platform.startswith('linux'):
483 binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include') 489 binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include')
484 490
485 if args.bootstrap: 491 if args.bootstrap:
486 print 'Building bootstrap compiler' 492 print 'Building bootstrap compiler'
487 EnsureDirExists(LLVM_BOOTSTRAP_DIR) 493 EnsureDirExists(LLVM_BOOTSTRAP_DIR)
488 os.chdir(LLVM_BOOTSTRAP_DIR) 494 os.chdir(LLVM_BOOTSTRAP_DIR)
489 bootstrap_args = base_cmake_args + [ 495 bootstrap_args = base_cmake_args + [
490 '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir, 496 '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 libstdcpp = subprocess.check_output( 651 libstdcpp = subprocess.check_output(
646 [cxx] + cxxflags + ['-print-file-name=libstdc++.so.6']).rstrip() 652 [cxx] + cxxflags + ['-print-file-name=libstdc++.so.6']).rstrip()
647 CopyFile(libstdcpp, os.path.join(LLVM_BUILD_DIR, 'lib')) 653 CopyFile(libstdcpp, os.path.join(LLVM_BUILD_DIR, 'lib'))
648 654
649 RunCommand(['ninja'], msvc_arch='x64') 655 RunCommand(['ninja'], msvc_arch='x64')
650 656
651 if args.tools: 657 if args.tools:
652 # If any Chromium tools were built, install those now. 658 # If any Chromium tools were built, install those now.
653 RunCommand(['ninja', 'cr-install'], msvc_arch='x64') 659 RunCommand(['ninja', 'cr-install'], msvc_arch='x64')
654 660
655 if sys.platform == 'darwin': 661 if not use_head_revision:
656 # See http://crbug.com/256342 662 # Strip the binaries to save size, except for ToT builds.
657 RunCommand(['strip', '-x', os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')]) 663 if sys.platform == 'darwin':
658 elif sys.platform.startswith('linux'): 664 # See http://crbug.com/256342
659 RunCommand(['strip', os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')]) 665 RunCommand(['strip', '-x', os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')])
666 elif sys.platform.startswith('linux'):
667 RunCommand(['strip', os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')])
660 668
661 # TODO(thakis): Check that `clang --version` matches VERSION. 669 # TODO(thakis): Check that `clang --version` matches VERSION.
662 670
663 # Do an out-of-tree build of compiler-rt. 671 # Do an out-of-tree build of compiler-rt.
664 # On Windows, this is used to get the 32-bit ASan run-time. 672 # On Windows, this is used to get the 32-bit ASan run-time.
665 # TODO(hans): Remove once the regular build above produces this. 673 # TODO(hans): Remove once the regular build above produces this.
666 # On Mac and Linux, this is used to get the regular 64-bit run-time. 674 # On Mac and Linux, this is used to get the regular 64-bit run-time.
667 # Do a clobbered build due to cmake changes. 675 # Do a clobbered build due to cmake changes.
668 if os.path.isdir(COMPILER_RT_BUILD_DIR): 676 if os.path.isdir(COMPILER_RT_BUILD_DIR):
669 RmTree(COMPILER_RT_BUILD_DIR) 677 RmTree(COMPILER_RT_BUILD_DIR)
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 args.force_local_build = True 903 args.force_local_build = True
896 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): 904 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''):
897 # Only build the Android ASan rt on ToT bots when targetting Android. 905 # Only build the Android ASan rt on ToT bots when targetting Android.
898 args.with_android = False 906 args.with_android = False
899 907
900 return UpdateClang(args) 908 return UpdateClang(args)
901 909
902 910
903 if __name__ == '__main__': 911 if __name__ == '__main__':
904 sys.exit(main()) 912 sys.exit(main())
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