Commit 0f288583 authored by Fabrice de Gans-Riberi's avatar Fabrice de Gans-Riberi Committed by Commit Bot

Add llvm-strip and llvm-ar binaries.

This adds llvm-strip for Linux and Mac and llvm-ar for Mac. These are
needed to build Fuchsia on Mac and Linux hosts. For now, llvm-strip is
in a separate package.

Bug: 877080
Change-Id: If10284d6f76b0cf2397ccbe9d64b98abf04589d0
Reviewed-on: https://chromium-review.googlesource.com/1193949
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588084}
parent f5ff392e
......@@ -25,6 +25,10 @@
gsutil.py cp -n -a public-read gs://chromium-browser-clang-staging/$x/llvm-code-coverage-$rev.tgz \
gs://chromium-browser-clang/$x/llvm-code-coverage-$rev.tgz ; \
done
$ for x in Linux_x64 Mac ; do \
gsutil.py cp -n -a public-read gs://chromium-browser-clang-staging/$x/llvmstrip-$rev.tgz \
gs://chromium-browser-clang/$x/llvmstrip-$rev.tgz ; \
done
$ gsutil.py cp -n -a public-read gs://chromium-browser-clang-staging/Mac/lld-$rev.tgz \
gs://chromium-browser-clang/Mac/lld-$rev.tgz
```
......
#!/usr/bin/env python
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script to download llvm-strip from google storage."""
import os
import sys
import update
LLVM_BUILD_DIR = update.LLVM_BUILD_DIR
STRIP_PATH = os.path.join(LLVM_BUILD_DIR, 'bin', 'llvm-strip')
STAMP_FILE = os.path.normpath(
os.path.join(LLVM_BUILD_DIR, 'llvmstrip_build_revision'))
def AlreadyUpToDate():
if not os.path.exists(STRIP_PATH):
return False
stamp = update.ReadStampFile(STAMP_FILE)
return stamp.rstrip() == update.PACKAGE_VERSION
def main():
if not AlreadyUpToDate():
cds_file = 'llvmstrip-%s.tgz' % update.PACKAGE_VERSION
cds_full_url = update.GetPlatformUrlPrefix(sys.platform) + cds_file
update.DownloadAndUnpack(cds_full_url, update.LLVM_BUILD_DIR)
return 0
if __name__ == '__main__':
sys.exit(main())
......@@ -415,6 +415,8 @@ def main():
os.makedirs(os.path.join(llddir, 'bin'))
shutil.copy(os.path.join(LLVM_RELEASE_DIR, 'bin', 'lld'),
os.path.join(llddir, 'bin'))
shutil.copy(os.path.join(LLVM_RELEASE_DIR, 'bin', 'llvm-ar'),
os.path.join(llddir, 'bin'))
os.symlink('lld', os.path.join(llddir, 'bin', 'lld-link'))
os.symlink('lld', os.path.join(llddir, 'bin', 'ld.lld'))
with tarfile.open(llddir + '.tgz', 'w:gz') as tar:
......@@ -422,6 +424,26 @@ def main():
filter=PrintTarProgress)
MaybeUpload(args, llddir, platform)
# On Linux and Mac, package and upload llvm-strip in a separate zip.
# This is used for the Fuchsia build.
if sys.platform == 'darwin' or sys.platform.startswith('linux'):
stripdir = 'llvmstrip-' + stamp
shutil.rmtree(stripdir, ignore_errors=True)
os.makedirs(os.path.join(stripdir, 'bin'))
shutil.copy(os.path.join(LLVM_RELEASE_DIR, 'bin', 'llvm-strip'),
os.path.join(stripdir, 'bin'))
llvmstrip_stamp_file_base = 'llvmstrip_build_revision'
llvmstrip_stamp_file = os.path.join(stripdir, llvmstrip_stamp_file_base)
with open(llvmstrip_stamp_file, 'w') as f:
f.write(expected_stamp)
f.write('\n')
with tarfile.open(stripdir + '.tgz', 'w:gz') as tar:
tar.add(os.path.join(stripdir, 'bin'), arcname='bin',
filter=PrintTarProgress)
tar.add(llvmstrip_stamp_file, arcname=llvmstrip_stamp_file_base,
filter=PrintTarProgress)
MaybeUpload(args, stripdir, platform)
# Zip up the translation_unit tool.
translation_unit_dir = 'translation_unit-' + stamp
shutil.rmtree(translation_unit_dir, ignore_errors=True)
......
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