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

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

Issue 2210383003: Revert of 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',
473 '-DLLVM_ENABLE_ASSERTIONS=ON', 474 '-DLLVM_ENABLE_ASSERTIONS=ON',
474 '-DLLVM_ENABLE_THREADS=OFF', 475 '-DLLVM_ENABLE_THREADS=OFF',
475 '-DLLVM_ENABLE_TIMESTAMPS=OFF', 476 '-DLLVM_ENABLE_TIMESTAMPS=OFF',
476 # Statically link MSVCRT to avoid DLL dependencies. 477 # Statically link MSVCRT to avoid DLL dependencies.
477 '-DLLVM_USE_CRT_RELEASE=MT', 478 '-DLLVM_USE_CRT_RELEASE=MT',
478 ] 479 ]
479 480
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
487 binutils_incdir = '' 481 binutils_incdir = ''
488 if sys.platform.startswith('linux'): 482 if sys.platform.startswith('linux'):
489 binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include') 483 binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include')
490 484
491 if args.bootstrap: 485 if args.bootstrap:
492 print 'Building bootstrap compiler' 486 print 'Building bootstrap compiler'
493 EnsureDirExists(LLVM_BOOTSTRAP_DIR) 487 EnsureDirExists(LLVM_BOOTSTRAP_DIR)
494 os.chdir(LLVM_BOOTSTRAP_DIR) 488 os.chdir(LLVM_BOOTSTRAP_DIR)
495 bootstrap_args = base_cmake_args + [ 489 bootstrap_args = base_cmake_args + [
496 '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir, 490 '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 libstdcpp = subprocess.check_output( 645 libstdcpp = subprocess.check_output(
652 [cxx] + cxxflags + ['-print-file-name=libstdc++.so.6']).rstrip() 646 [cxx] + cxxflags + ['-print-file-name=libstdc++.so.6']).rstrip()
653 CopyFile(libstdcpp, os.path.join(LLVM_BUILD_DIR, 'lib')) 647 CopyFile(libstdcpp, os.path.join(LLVM_BUILD_DIR, 'lib'))
654 648
655 RunCommand(['ninja'], msvc_arch='x64') 649 RunCommand(['ninja'], msvc_arch='x64')
656 650
657 if args.tools: 651 if args.tools:
658 # If any Chromium tools were built, install those now. 652 # If any Chromium tools were built, install those now.
659 RunCommand(['ninja', 'cr-install'], msvc_arch='x64') 653 RunCommand(['ninja', 'cr-install'], msvc_arch='x64')
660 654
661 if not use_head_revision: 655 if sys.platform == 'darwin':
662 # Strip the binaries to save size, except for ToT builds. 656 # See http://crbug.com/256342
663 if sys.platform == 'darwin': 657 RunCommand(['strip', '-x', os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')])
664 # See http://crbug.com/256342 658 elif sys.platform.startswith('linux'):
665 RunCommand(['strip', '-x', os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')]) 659 RunCommand(['strip', 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')])
668 660
669 # TODO(thakis): Check that `clang --version` matches VERSION. 661 # TODO(thakis): Check that `clang --version` matches VERSION.
670 662
671 # Do an out-of-tree build of compiler-rt. 663 # Do an out-of-tree build of compiler-rt.
672 # On Windows, this is used to get the 32-bit ASan run-time. 664 # On Windows, this is used to get the 32-bit ASan run-time.
673 # TODO(hans): Remove once the regular build above produces this. 665 # TODO(hans): Remove once the regular build above produces this.
674 # On Mac and Linux, this is used to get the regular 64-bit run-time. 666 # On Mac and Linux, this is used to get the regular 64-bit run-time.
675 # Do a clobbered build due to cmake changes. 667 # Do a clobbered build due to cmake changes.
676 if os.path.isdir(COMPILER_RT_BUILD_DIR): 668 if os.path.isdir(COMPILER_RT_BUILD_DIR):
677 RmTree(COMPILER_RT_BUILD_DIR) 669 RmTree(COMPILER_RT_BUILD_DIR)
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 args.force_local_build = True 895 args.force_local_build = True
904 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): 896 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''):
905 # Only build the Android ASan rt on ToT bots when targetting Android. 897 # Only build the Android ASan rt on ToT bots when targetting Android.
906 args.with_android = False 898 args.with_android = False
907 899
908 return UpdateClang(args) 900 return UpdateClang(args)
909 901
910 902
911 if __name__ == '__main__': 903 if __name__ == '__main__':
912 sys.exit(main()) 904 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