Commit 54d768db authored by thakis@chromium.org's avatar thakis@chromium.org

roll clang 138187:138188

(Rolling just 1 revision because something farther on seems to tickle an ld crash, but I'd like to get the rest of this CL in.)

Also pass --disable-threads and --disable-pthreads to configure, for goma.

Also modify the script to try to download prebuilt binaries first. This is faster,
and makes sure the bots use the exact same binary as goma. The binaries are
downloaded from http://commondatastorage.googleapis.com/chromium-browser-clang/index.html

Also add a script that packages a clang build up into a tgz for uploading with
gsutil, based on code by ukai@.

Finally, if the svn checkout fails, remove the destination directory and try
again (for bots that have a checkout from before we had an internal llvm svn
mirror).

BUG=none
TEST=none

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98416

Review URL: http://codereview.chromium.org/7741039

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98541 0039d316-1c4b-4281-b951-d872f2087c98
parent 7bbf04d9
...@@ -35,7 +35,7 @@ vars = { ...@@ -35,7 +35,7 @@ vars = {
# Note: On most bots, clang is not checked out via DEPS but by # Note: On most bots, clang is not checked out via DEPS but by
# tools/clang/scripts/update.sh. The script reads this line here. # tools/clang/scripts/update.sh. The script reads this line here.
"clang_revision": "138187", "clang_revision": "138188",
} }
deps = { deps = {
......
#!/bin/bash
# Copyright (c) 2011 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.
# This script will check out llvm and clang, and then package the results up
# to a tgz file.
THIS_DIR="$(dirname "${0}")"
LLVM_BUILD_DIR="${THIS_DIR}/../../../third_party/llvm-build"
LLVM_BIN_DIR="${LLVM_BUILD_DIR}/Release+Asserts/bin"
LLVM_LIB_DIR="${LLVM_BUILD_DIR}/Release+Asserts/lib"
set -ex
# Do a clobber build.
rm -rf "${LLVM_BUILD_DIR}"
"${THIS_DIR}"/update.sh
R=$("${LLVM_BIN_DIR}/clang" --version | \
sed -ne 's/clang version .*(trunk \([0-9]*\))/\1/p')
PDIR=clang-$R
rm -rf $PDIR
mkdir $PDIR
mkdir $PDIR/bin
mkdir $PDIR/lib
# Copy clang into pdir, symlink clang++ to it.
cp "${LLVM_BIN_DIR}/clang" $PDIR/bin/
(cd $PDIR/bin && ln -sf clang clang++ && cd -)
# Copy plugins. Some of the dylibs are pretty big, so copy only the ones we
# care about.
if [ "$(uname -s)" = "Darwin" ]; then
cp "${LLVM_LIB_DIR}/libFindBadConstructs.dylib" $PDIR/lib
else
cp "${LLVM_LIB_DIR}/libFindBadConstructs.so" $PDIR/lib
fi
# Copy built-in headers (lib/clang/3.0/include).
cp -R "${LLVM_LIB_DIR}/clang" $PDIR/lib
tar zcf $PDIR.tgz -C $PDIR bin lib
if [ "$(uname -s)" = "Darwin" ]; then
PLATFORM=Mac
else
PLATFORM=Linux_x64
fi
echo To upload, run:
echo gsutil cp -a public-read $PDIR.tgz \
gs://chromium-browser-clang/$PLATFORM/$PDIR.tgz
...@@ -34,11 +34,37 @@ fi ...@@ -34,11 +34,37 @@ fi
# To always force a new build if someone interrupts their build half way. # To always force a new build if someone interrupts their build half way.
rm -f "${STAMP_FILE}" rm -f "${STAMP_FILE}"
# Check if there's a prebuilt binary and if so just fetch that. That's faster,
# and goma relies on having matching binary hashes on client and server too.
CDS_URL=http://commondatastorage.googleapis.com/chromium-browser-clang
CDS_FILE="clang-${CLANG_REVISION}.tgz"
echo Trying to download prebuilt clang
if [ "$(uname -s)" = "Linux" ]; then
wget "${CDS_URL}/Linux_x64/${CDS_FILE}" || rm -f "${CDS_FILE}"
elif [ "$(uname -s)" = "Darwin" ]; then
curl -L --fail -O "${CDS_URL}/Mac/${CDS_FILE}" || rm -f "${CDS_FILE}"
fi
if [ -f "${CDS_FILE}" ]; then
rm -rf "${LLVM_BUILD_DIR}/Release+Asserts"
mkdir -p "${LLVM_BUILD_DIR}/Release+Asserts"
tar -xzf "${CDS_FILE}" -C "${LLVM_BUILD_DIR}/Release+Asserts"
echo clang "${CLANG_REVISION}" unpacked
echo "${CLANG_REVISION}" > "${STAMP_FILE}"
exit 0
else
echo Did not find prebuilt clang at r"${CLANG_REVISION}", building
fi
if grep -q 'src/third_party/llvm":' "${DEPS_FILE}"; then if grep -q 'src/third_party/llvm":' "${DEPS_FILE}"; then
echo LLVM pulled in through DEPS, skipping LLVM update step echo LLVM pulled in through DEPS, skipping LLVM update step
else else
echo Getting LLVM r"${CLANG_REVISION}" in "${LLVM_DIR}" echo Getting LLVM r"${CLANG_REVISION}" in "${LLVM_DIR}"
svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" "${LLVM_DIR}" if ! svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" \
"${LLVM_DIR}"; then
echo Checkout failed, retrying
rm -rf "${LLVM_DIR}"
svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" "${LLVM_DIR}"
fi
fi fi
if grep -q 'src/third_party/llvm/tools/clang":' "${DEPS_FILE}"; then if grep -q 'src/third_party/llvm/tools/clang":' "${DEPS_FILE}"; then
...@@ -59,6 +85,8 @@ cd "${LLVM_BUILD_DIR}" ...@@ -59,6 +85,8 @@ cd "${LLVM_BUILD_DIR}"
if [ ! -f ./config.status ]; then if [ ! -f ./config.status ]; then
../llvm/configure \ ../llvm/configure \
--enable-optimized \ --enable-optimized \
--disable-threads \
--disable-pthreads \
--without-llvmgcc \ --without-llvmgcc \
--without-llvmgxx --without-llvmgxx
fi fi
......
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