Commit 49fd24fe authored by Hans Wennborg's avatar Hans Wennborg Committed by Commit Bot

Clang packaging script: don't build lld with thinlto

This shaves a few minutes off the clang packaging time, simplifies our
build script, and brings the build config for lld closer to that for
clang so that we can potentially build them in one go in the future.

Building lld without thinlto does not appear to affect its performance.

Bug: 884608
Change-Id: I4c3c39aa935fdb0a0977b1dd46400eee02d76dde
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089835
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748150}
parent b57f55e2
......@@ -343,8 +343,6 @@ def main():
parser.add_argument('--gcc-toolchain', help='what gcc toolchain to use for '
'building; --gcc-toolchain=/opt/foo picks '
'/opt/foo/bin/gcc')
parser.add_argument('--lto-lld', action='store_true',
help='build lld with LTO (only applies on Linux)')
parser.add_argument('--pgo', action='store_true', help='build with PGO')
parser.add_argument('--llvm-force-head-revision', action='store_true',
help='build the latest revision')
......@@ -371,13 +369,6 @@ def main():
default=sys.platform in ('linux2', 'darwin'))
args = parser.parse_args()
if args.lto_lld and not args.bootstrap:
print('--lto-lld requires --bootstrap')
return 1
if args.lto_lld and not sys.platform.startswith('linux'):
# TODO(hans): Use it on Windows too.
print('--lto-lld is only effective on Linux. Ignoring the option.')
args.lto_lld = False
if args.pgo and not args.bootstrap:
print('--pgo requires --bootstrap')
return 1
......@@ -525,7 +516,7 @@ def main():
if args.pgo:
# Need libclang_rt.profile
projects += ';compiler-rt'
if sys.platform != 'darwin' or args.lto_lld:
if sys.platform != 'darwin':
projects += ';lld'
if sys.platform == 'darwin':
# Need libc++ and compiler-rt for the bootstrap compiler on mac.
......@@ -762,22 +753,6 @@ def main():
if lld is not None:
threads_enabled_cmake_args.append('-DCMAKE_LINKER=' + lld)
if args.lto_lld:
# Build lld with LTO. That speeds up the linker by ~10%.
# We only use LTO for Linux now.
#
# The linker expects all archive members to have symbol tables, so the
# archiver needs to be able to create symbol tables for bitcode files.
# GNU ar and ranlib don't understand bitcode files, but llvm-ar and
# llvm-ranlib do, so use them.
ar = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'llvm-ar')
ranlib = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'llvm-ranlib')
threads_enabled_cmake_args += [
'-DCMAKE_AR=' + ar,
'-DCMAKE_RANLIB=' + ranlib,
'-DLLVM_ENABLE_LTO=thin',
]
RunCommand(['cmake'] + threads_enabled_cmake_args +
[os.path.join(LLVM_DIR, 'llvm')],
msvc_arch='x64', env=deployment_env)
......
......@@ -187,8 +187,6 @@ def main():
build_cmd = [sys.executable, os.path.join(THIS_DIR, 'build.py'),
'--bootstrap', '--disable-asserts',
'--run-tests', '--pgo']
if sys.platform.startswith('linux'):
build_cmd.append('--lto-lld')
TeeCmd(build_cmd, log)
stamp = open(STAMP_FILE).read().rstrip()
......
......@@ -41,7 +41,7 @@ import zipfile
# Reverting problematic clang rolls is safe, though.
CLANG_REVISION = '9284abd0040afecfd619dbcf1b244a8b533291c9'
CLANG_SVN_REVISION = 'n344329'
CLANG_SUB_REVISION = 1
CLANG_SUB_REVISION = 2
PACKAGE_VERSION = '%s-%s-%s' % (CLANG_SVN_REVISION, CLANG_REVISION[:8],
CLANG_SUB_REVISION)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment