| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # This script will check out llvm and clang, and then package the results up | 6 # This script will check out llvm and clang, and then package the results up |
| 7 # to a tgz file. | 7 # to a tgz file. |
| 8 | 8 |
| 9 PLUGIN_REVISION="$1" |
| 10 |
| 9 THIS_DIR="$(dirname "${0}")" | 11 THIS_DIR="$(dirname "${0}")" |
| 10 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" | 12 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" |
| 11 LLVM_BOOTSTRAP_DIR="${THIS_DIR}/../../../third_party/llvm-bootstrap" | 13 LLVM_BOOTSTRAP_DIR="${THIS_DIR}/../../../third_party/llvm-bootstrap" |
| 12 LLVM_BUILD_DIR="${THIS_DIR}/../../../third_party/llvm-build" | 14 LLVM_BUILD_DIR="${THIS_DIR}/../../../third_party/llvm-build" |
| 13 LLVM_BIN_DIR="${LLVM_BUILD_DIR}/Release+Asserts/bin" | 15 LLVM_BIN_DIR="${LLVM_BUILD_DIR}/Release+Asserts/bin" |
| 14 LLVM_LIB_DIR="${LLVM_BUILD_DIR}/Release+Asserts/lib" | 16 LLVM_LIB_DIR="${LLVM_BUILD_DIR}/Release+Asserts/lib" |
| 15 | 17 |
| 16 echo "Diff in llvm:" | tee buildlog.txt | 18 echo "Diff in llvm:" | tee buildlog.txt |
| 17 svn stat "${LLVM_DIR}" 2>&1 | tee -a buildlog.txt | 19 svn stat "${LLVM_DIR}" 2>&1 | tee -a buildlog.txt |
| 18 svn diff "${LLVM_DIR}" 2>&1 | tee -a buildlog.txt | 20 svn diff "${LLVM_DIR}" 2>&1 | tee -a buildlog.txt |
| (...skipping 10 matching lines...) Expand all Loading... |
| 29 | 31 |
| 30 # Do a clobber build. | 32 # Do a clobber build. |
| 31 rm -rf "${LLVM_BOOTSTRAP_DIR}" | 33 rm -rf "${LLVM_BOOTSTRAP_DIR}" |
| 32 rm -rf "${LLVM_BUILD_DIR}" | 34 rm -rf "${LLVM_BUILD_DIR}" |
| 33 "${THIS_DIR}"/update.sh --run-tests --bootstrap --force-local-build 2>&1 | \ | 35 "${THIS_DIR}"/update.sh --run-tests --bootstrap --force-local-build 2>&1 | \ |
| 34 tee -a buildlog.txt | 36 tee -a buildlog.txt |
| 35 | 37 |
| 36 R=$("${LLVM_BIN_DIR}/clang" --version | \ | 38 R=$("${LLVM_BIN_DIR}/clang" --version | \ |
| 37 sed -ne 's/clang version .*(trunk \([0-9]*\))/\1/p') | 39 sed -ne 's/clang version .*(trunk \([0-9]*\))/\1/p') |
| 38 | 40 |
| 39 PDIR=clang-$R | 41 PDIR=clang-$R$PLUGIN_REVISION |
| 40 rm -rf $PDIR | 42 rm -rf $PDIR |
| 41 mkdir $PDIR | 43 mkdir $PDIR |
| 42 mkdir $PDIR/bin | 44 mkdir $PDIR/bin |
| 43 mkdir $PDIR/lib | 45 mkdir $PDIR/lib |
| 44 | 46 |
| 45 if [ "$(uname -s)" = "Darwin" ]; then | 47 if [ "$(uname -s)" = "Darwin" ]; then |
| 46 SO_EXT="dylib" | 48 SO_EXT="dylib" |
| 47 else | 49 else |
| 48 SO_EXT="so" | 50 SO_EXT="so" |
| 49 fi | 51 fi |
| 50 | 52 |
| 51 # Copy buildlog over. | 53 # Copy buildlog over. |
| 52 cp buildlog.txt $PDIR/ | 54 cp buildlog.txt $PDIR/ |
| 53 | 55 |
| 54 # Copy clang into pdir, symlink clang++ to it. | 56 # Copy clang into pdir, symlink clang++ to it. |
| 55 cp "${LLVM_BIN_DIR}/clang" $PDIR/bin/ | 57 cp "${LLVM_BIN_DIR}/clang" $PDIR/bin/ |
| 56 (cd $PDIR/bin && ln -sf clang clang++ && cd -) | 58 (cd $PDIR/bin && ln -sf clang clang++ && cd -) |
| 57 cp "${LLVM_BIN_DIR}/llvm-symbolizer" $PDIR/bin/ | 59 cp "${LLVM_BIN_DIR}/llvm-symbolizer" $PDIR/bin/ |
| 58 | 60 |
| 59 # Copy plugins. Some of the dylibs are pretty big, so copy only the ones we | 61 # Copy plugins. Some of the dylibs are pretty big, so copy only the ones we |
| 60 # care about. | 62 # care about. |
| 61 cp "${LLVM_LIB_DIR}/libFindBadConstructs.${SO_EXT}" $PDIR/lib | 63 cp "${LLVM_LIB_DIR}/libFindBadConstructs.${SO_EXT}" $PDIR/lib |
| 64 cp "${LLVM_LIB_DIR}/libBlinkGCPlugin.${SO_EXT}" $PDIR/lib |
| 62 | 65 |
| 63 # Copy built-in headers (lib/clang/3.2/include). | 66 # Copy built-in headers (lib/clang/3.2/include). |
| 64 # libcompiler-rt puts all kinds of libraries there too, but we want only some. | 67 # libcompiler-rt puts all kinds of libraries there too, but we want only some. |
| 65 if [ "$(uname -s)" = "Darwin" ]; then | 68 if [ "$(uname -s)" = "Darwin" ]; then |
| 66 # Keep only | 69 # Keep only |
| 67 # Release+Asserts/lib/clang/*/lib/darwin/libclang_rt.{asan,profile}_osx* | 70 # Release+Asserts/lib/clang/*/lib/darwin/libclang_rt.{asan,profile}_osx* |
| 68 find "${LLVM_LIB_DIR}/clang" -type f -path '*lib/darwin*' \ | 71 find "${LLVM_LIB_DIR}/clang" -type f -path '*lib/darwin*' \ |
| 69 ! -name '*asan_osx*' ! -name '*profile_osx*' | xargs rm | 72 ! -name '*asan_osx*' ! -name '*profile_osx*' | xargs rm |
| 70 # Fix LC_ID_DYLIB for the ASan dynamic library to be relative to | 73 # Fix LC_ID_DYLIB for the ASan dynamic library to be relative to |
| 71 # @executable_path. | 74 # @executable_path. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 87 | 90 |
| 88 if [ "$(uname -s)" = "Darwin" ]; then | 91 if [ "$(uname -s)" = "Darwin" ]; then |
| 89 PLATFORM=Mac | 92 PLATFORM=Mac |
| 90 else | 93 else |
| 91 PLATFORM=Linux_x64 | 94 PLATFORM=Linux_x64 |
| 92 fi | 95 fi |
| 93 | 96 |
| 94 echo To upload, run: | 97 echo To upload, run: |
| 95 echo gsutil cp -a public-read $PDIR.tgz \ | 98 echo gsutil cp -a public-read $PDIR.tgz \ |
| 96 gs://chromium-browser-clang/$PLATFORM/$PDIR.tgz | 99 gs://chromium-browser-clang/$PLATFORM/$PDIR.tgz |
| OLD | NEW |