| Index: tools/clang/scripts/update.py
|
| diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
|
| index 501bc9f127241f04ce1d505ceecb8a902a7482e1..64c520700d6fb4ba016fe52a1ceff21bec9b49c2 100755
|
| --- a/tools/clang/scripts/update.py
|
| +++ b/tools/clang/scripts/update.py
|
| @@ -34,7 +34,7 @@ if use_head_revision:
|
| CLANG_REVISION = 'HEAD'
|
|
|
| # This is incremented when pushing a new build of Clang at the same revision.
|
| -CLANG_SUB_REVISION=1
|
| +CLANG_SUB_REVISION=2
|
|
|
| PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION)
|
|
|
| @@ -66,11 +66,10 @@ LLVM_BUILD_TOOLS_DIR = os.path.abspath(
|
| os.path.join(LLVM_DIR, '..', 'llvm-build-tools'))
|
| STAMP_FILE = os.path.normpath(
|
| os.path.join(LLVM_DIR, '..', 'llvm-build', 'cr_build_revision'))
|
| -BINUTILS_DIR = os.path.join(THIRD_PARTY_DIR, 'binutils')
|
| -BINUTILS_BIN_DIR = os.path.join(BINUTILS_DIR, BINUTILS_DIR,
|
| - 'Linux_x64', 'Release', 'bin')
|
| -BFD_PLUGINS_DIR = os.path.join(BINUTILS_DIR, 'Linux_x64', 'Release',
|
| - 'lib', 'bfd-plugins')
|
| +BINUTILS_DIR = os.path.join(THIRD_PARTY_DIR, 'binutils', 'Linux_x64', 'Release')
|
| +BINUTILS_BIN_DIR = os.path.join(BINUTILS_DIR, 'bin')
|
| +BINUTILS_LIB_DIR = os.path.join(BINUTILS_DIR, 'lib')
|
| +BFD_PLUGINS_DIR = os.path.join(BINUTILS_LIB_DIR, 'bfd-plugins')
|
| VERSION = '5.0.0'
|
| ANDROID_NDK_DIR = os.path.join(
|
| CHROMIUM_DIR, 'third_party', 'android_tools', 'ndk')
|
| @@ -503,7 +502,7 @@ def UpdateClang(args):
|
|
|
| binutils_incdir = ''
|
| if sys.platform.startswith('linux'):
|
| - binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include')
|
| + binutils_incdir = os.path.join(BINUTILS_DIR, 'include')
|
|
|
| if args.bootstrap:
|
| print 'Building bootstrap compiler'
|
| @@ -565,6 +564,13 @@ def UpdateClang(args):
|
| os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'lib', 'LLVMgold.so'),
|
| os.path.join(BFD_PLUGINS_DIR, 'LLVMgold.so')])
|
|
|
| + # Link against binutils's copy of tcmalloc to speed up the linker by ~10%.
|
| + # In package.py we copy the .so into our package.
|
| + tcmalloc_ldflags = ['-L' + BINUTILS_LIB_DIR, '-ltcmalloc_minimal']
|
| + # Make sure that tblgen and the test suite can find tcmalloc.
|
| + os.environ['LD_LIBRARY_PATH'] = \
|
| + BINUTILS_LIB_DIR + os.pathsep + os.environ.get('LD_LIBRARY_PATH', '')
|
| +
|
| lto_cflags = ['-flto=thin']
|
| lto_ldflags = ['-fuse-ld=lld']
|
| if args.gcc_toolchain:
|
| @@ -577,7 +583,7 @@ def UpdateClang(args):
|
| '-DCMAKE_CXX_COMPILER=' + cxx,
|
| '-DCMAKE_C_FLAGS=' + ' '.join(lto_cflags),
|
| '-DCMAKE_CXX_FLAGS=' + ' '.join(lto_cflags),
|
| - '-DCMAKE_EXE_LINKER_FLAGS=' + ' '.join(lto_ldflags),
|
| + '-DCMAKE_EXE_LINKER_FLAGS=' + ' '.join(lto_ldflags + tcmalloc_ldflags),
|
| '-DCMAKE_SHARED_LINKER_FLAGS=' + ' '.join(lto_ldflags),
|
| '-DCMAKE_MODULE_LINKER_FLAGS=' + ' '.join(lto_ldflags)]
|
|
|
|
|