Commit 933b64fe authored by Jonathan Ross's avatar Jonathan Ross

Revert "Clang: stop building with GCC/libstdc++ from Ubuntu Precise (roll 338452-1:338452-2)"

This reverts commit 1501aabf.

Reason for revert: Various compiles are failing on targets not being changed in those ranges

Each with a similar compiler error: No matching compiler(clang++ 4.2.1[clang version 7.0.0 (trunk 338452)]

Example failure: https://www.google.com/url?sa=j&url=https%3A%2F%2Fci.chromium.org%2Fp%2Fchromium%2Fbuilders%2Fluci.chromium.ci%2FLinux%2520Builder%2520%2528dbg%2529%252832%2529%2F86901&uct=1516637227&usg=pKzrEj68lML-ZPjHPTSWUKP4wTA.

Original change's description:
> Clang: stop building with GCC/libstdc++ from Ubuntu Precise (roll 338452-1:338452-2)
> 
> Previously we used a GCC/libstdc++ package from Ubuntu Precise to build a Clang
> that would work on Precise or later. These days, all bots and developers are on
> Trusty or later, so this should no longer be necessary.
> 
> Bug: none
> Change-Id: I518ee55d07c04dc89163fe262c81d935e05fed78
> Reviewed-on: https://chromium-review.googlesource.com/1183915
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
> Commit-Queue: Hans Wennborg <hans@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#585067}

TBR=thakis@chromium.org,hans@chromium.org,thomasanderson@chromium.org

Change-Id: I9a21a41db52458d77b949842e11b13dbec02368c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/1185104Reviewed-by: default avatarJonathan Ross <jonross@chromium.org>
Commit-Queue: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585110}
parent 6466c6d2
......@@ -35,7 +35,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=2
CLANG_SUB_REVISION=1
PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION)
......@@ -307,6 +307,18 @@ def CreateChromeToolsShim():
f.write('endif (CHROMIUM_TOOLS_SRC)\n')
def DownloadHostGcc(args):
"""Downloads gcc 4.8.5 and makes sure args.gcc_toolchain is set."""
if not sys.platform.startswith('linux') or args.gcc_toolchain:
return
gcc_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'gcc485precise')
if not os.path.exists(gcc_dir):
print 'Downloading pre-built GCC 4.8.5...'
DownloadAndUnpack(
CDS_URL + '/tools/gcc485precise.tgz', LLVM_BUILD_TOOLS_DIR)
args.gcc_toolchain = gcc_dir
def AddSvnToPathOnWin():
"""Download svn.exe and add it to PATH."""
if sys.platform != 'win32':
......@@ -489,6 +501,7 @@ def UpdateClang(args):
print 'Removing old lib dir: %s' % old_lib_dir
RmTree(old_lib_dir)
DownloadHostGcc(args)
AddCMakeToPath(args)
AddGnuWinToPath()
......@@ -501,6 +514,21 @@ def UpdateClang(args):
cc, cxx = None, None
libstdcpp = None
if args.gcc_toolchain: # This option is only used on Linux.
# Use the specified gcc installation for building.
cc = os.path.join(args.gcc_toolchain, 'bin', 'gcc')
cxx = os.path.join(args.gcc_toolchain, 'bin', 'g++')
if not os.access(cc, os.X_OK):
print 'Invalid --gcc-toolchain: "%s"' % args.gcc_toolchain
print '"%s" does not appear to be valid.' % cc
return 1
# Set LD_LIBRARY_PATH to make auxiliary targets (tablegen, bootstrap
# compiler, etc.) find the .so.
libstdcpp = subprocess.check_output(
[cxx, '-print-file-name=libstdc++.so.6']).rstrip()
os.environ['LD_LIBRARY_PATH'] = os.path.dirname(libstdcpp)
cflags = []
cxxflags = []
......@@ -550,6 +578,11 @@ def UpdateClang(args):
cc = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang')
cxx = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang++')
if args.gcc_toolchain:
# Tell the bootstrap compiler to use a specific gcc prefix to search
# for standard library headers and shared object files.
cflags = ['--gcc-toolchain=' + args.gcc_toolchain]
cxxflags = ['--gcc-toolchain=' + args.gcc_toolchain]
print 'Building final compiler'
# LLVM uses C++11 starting in llvm 3.5. On Linux, this means libstdc++4.7+ is
......
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