| OLD | NEW |
| 1 #!/usr/bin/env bash | 1 #!/usr/bin/env 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 into third_party/llvm and build it. | 6 # This script will check out llvm and clang into third_party/llvm and build it. |
| 7 | 7 |
| 8 # Do NOT CHANGE this if you don't know what you're doing -- see | 8 # Do NOT CHANGE this if you don't know what you're doing -- see |
| 9 # https://code.google.com/p/chromium/wiki/UpdatingClang | 9 # https://code.google.com/p/chromium/wiki/UpdatingClang |
| 10 # Reverting problematic clang rolls is safe, though. | 10 # Reverting problematic clang rolls is safe, though. |
| 11 CLANG_REVISION=242792 | 11 CLANG_REVISION=245402 |
| 12 | 12 |
| 13 # This is incremented when pushing a new build of Clang at the same revision. | 13 # This is incremented when pushing a new build of Clang at the same revision. |
| 14 CLANG_SUB_REVISION=1 | 14 CLANG_SUB_REVISION=1 |
| 15 | 15 |
| 16 PACKAGE_VERSION="${CLANG_REVISION}-${CLANG_SUB_REVISION}" | 16 PACKAGE_VERSION="${CLANG_REVISION}-${CLANG_SUB_REVISION}" |
| 17 | 17 |
| 18 THIS_DIR="$(dirname "${0}")" | 18 THIS_DIR="$(dirname "${0}")" |
| 19 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" | 19 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" |
| 20 LLVM_BUILD_DIR="${LLVM_DIR}/../llvm-build/Release+Asserts" | 20 LLVM_BUILD_DIR="${LLVM_DIR}/../llvm-build/Release+Asserts" |
| 21 COMPILER_RT_BUILD_DIR="${LLVM_DIR}/../llvm-build/compiler-rt" | 21 COMPILER_RT_BUILD_DIR="${LLVM_DIR}/../llvm-build/compiler-rt" |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 367 |
| 368 # While we're bundling our own libc++ on OS X, we need to compile libc++abi | 368 # While we're bundling our own libc++ on OS X, we need to compile libc++abi |
| 369 # into it too (since OS X 10.6 doesn't have libc++abi.dylib either). | 369 # into it too (since OS X 10.6 doesn't have libc++abi.dylib either). |
| 370 if [ "${OS}" = "Darwin" ]; then | 370 if [ "${OS}" = "Darwin" ]; then |
| 371 echo Getting libc++abi r"${CLANG_REVISION}" in "${LIBCXXABI_DIR}" | 371 echo Getting libc++abi r"${CLANG_REVISION}" in "${LIBCXXABI_DIR}" |
| 372 svn co --force "${LLVM_REPO_URL}/libcxxabi/trunk@${CLANG_REVISION}" \ | 372 svn co --force "${LLVM_REPO_URL}/libcxxabi/trunk@${CLANG_REVISION}" \ |
| 373 "${LIBCXXABI_DIR}" | 373 "${LIBCXXABI_DIR}" |
| 374 fi | 374 fi |
| 375 | 375 |
| 376 if [[ -n "$with_patches" ]]; then | 376 if [[ -n "$with_patches" ]]; then |
| 377 | 377 # No patches. |
| 378 # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974) | 378 true |
| 379 pushd "${CLANG_DIR}" | |
| 380 cat << 'EOF' | | |
| 381 --- test/Index/crash-recovery-modules.m»(revision 202554) | |
| 382 +++ test/Index/crash-recovery-modules.m»(working copy) | |
| 383 @@ -12,6 +12,8 @@ | |
| 384 | |
| 385 // REQUIRES: crash-recovery | |
| 386 // REQUIRES: shell | |
| 387 +// XFAIL: * | |
| 388 +// (PR11974) | |
| 389 | |
| 390 @import Crash; | |
| 391 EOF | |
| 392 patch -p0 | |
| 393 popd | |
| 394 | |
| 395 pushd "${CLANG_DIR}" | |
| 396 cat << 'EOF' | | |
| 397 --- unittests/libclang/LibclangTest.cpp (revision 215949) | |
| 398 +++ unittests/libclang/LibclangTest.cpp (working copy) | |
| 399 @@ -431,7 +431,7 @@ | |
| 400 EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU)); | |
| 401 } | |
| 402 | |
| 403 -TEST_F(LibclangReparseTest, ReparseWithModule) { | |
| 404 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) { | |
| 405 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;"; | |
| 406 const char *HeaderBottom = "\n};\n#endif\n"; | |
| 407 const char *MFile = "#include \"HeaderFile.h\"\nint main() {" | |
| 408 EOF | |
| 409 patch -p0 | |
| 410 popd | |
| 411 | |
| 412 # The UBSan run-time, which is now bundled with the ASan run-time, doesn't wor
k | |
| 413 # on Mac OS X 10.8 (PR23539). | |
| 414 pushd "${COMPILER_RT_DIR}" | |
| 415 cat << 'EOF' | | |
| 416 Index: CMakeLists.txt | |
| 417 =================================================================== | |
| 418 --- CMakeLists.txt» (revision 241602) | |
| 419 +++ CMakeLists.txt» (working copy) | |
| 420 @@ -305,6 +305,7 @@ | |
| 421 list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim) | |
| 422 endif() | |
| 423 endif() | |
| 424 + set(SANITIZER_MIN_OSX_VERSION "10.7") | |
| 425 if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7") | |
| 426 message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}") | |
| 427 endif() | |
| 428 EOF | |
| 429 patch -p0 | |
| 430 popd | |
| 431 | |
| 432 fi | 379 fi |
| 433 | 380 |
| 434 # Echo all commands. | 381 # Echo all commands. |
| 435 set -x | 382 set -x |
| 436 | 383 |
| 437 # Set default values for CC and CXX if they're not set in the environment. | 384 # Set default values for CC and CXX if they're not set in the environment. |
| 438 CC=${CC:-cc} | 385 CC=${CC:-cc} |
| 439 CXX=${CXX:-c++} | 386 CXX=${CXX:-c++} |
| 440 | 387 |
| 441 if [[ -n "${gcc_toolchain}" ]]; then | 388 if [[ -n "${gcc_toolchain}" ]]; then |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 mkdir -p "${COMPILER_RT_BUILD_DIR}" | 582 mkdir -p "${COMPILER_RT_BUILD_DIR}" |
| 636 pushd "${COMPILER_RT_BUILD_DIR}" | 583 pushd "${COMPILER_RT_BUILD_DIR}" |
| 637 | 584 |
| 638 rm -fv CMakeCache.txt | 585 rm -fv CMakeCache.txt |
| 639 MACOSX_DEPLOYMENT_TARGET=${deployment_target} cmake -GNinja \ | 586 MACOSX_DEPLOYMENT_TARGET=${deployment_target} cmake -GNinja \ |
| 640 -DCMAKE_BUILD_TYPE=Release \ | 587 -DCMAKE_BUILD_TYPE=Release \ |
| 641 -DLLVM_ENABLE_ASSERTIONS=ON \ | 588 -DLLVM_ENABLE_ASSERTIONS=ON \ |
| 642 -DLLVM_ENABLE_THREADS=OFF \ | 589 -DLLVM_ENABLE_THREADS=OFF \ |
| 643 -DCMAKE_C_COMPILER="${CC}" \ | 590 -DCMAKE_C_COMPILER="${CC}" \ |
| 644 -DCMAKE_CXX_COMPILER="${CXX}" \ | 591 -DCMAKE_CXX_COMPILER="${CXX}" \ |
| 592 -DSANITIZER_MIN_OSX_VERSION="10.7" \ |
| 645 -DLLVM_CONFIG_PATH="${ABS_LLVM_BUILD_DIR}/bin/llvm-config" \ | 593 -DLLVM_CONFIG_PATH="${ABS_LLVM_BUILD_DIR}/bin/llvm-config" \ |
| 646 "${ABS_COMPILER_RT_DIR}" | 594 "${ABS_COMPILER_RT_DIR}" |
| 647 | 595 |
| 648 ninja | 596 ninja |
| 649 | 597 |
| 650 # Copy selected output to the main tree. | 598 # Copy selected output to the main tree. |
| 651 # Darwin doesn't support cp --parents, so pipe through tar instead. | 599 # Darwin doesn't support cp --parents, so pipe through tar instead. |
| 652 CLANG_VERSION=$("${ABS_LLVM_BUILD_DIR}/bin/clang" --version | \ | 600 CLANG_VERSION=$("${ABS_LLVM_BUILD_DIR}/bin/clang" --version | \ |
| 653 sed -ne 's/clang version \([0-9]\.[0-9]\.[0-9]\).*/\1/p') | 601 sed -ne 's/clang version \([0-9]\.[0-9]\.[0-9]\).*/\1/p') |
| 654 ABS_LLVM_CLANG_LIB_DIR="${ABS_LLVM_BUILD_DIR}/lib/clang/${CLANG_VERSION}" | 602 ABS_LLVM_CLANG_LIB_DIR="${ABS_LLVM_BUILD_DIR}/lib/clang/${CLANG_VERSION}" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 # Run Chrome tool tests. | 659 # Run Chrome tool tests. |
| 712 ninja -C "${LLVM_BUILD_DIR}" cr-check-all | 660 ninja -C "${LLVM_BUILD_DIR}" cr-check-all |
| 713 fi | 661 fi |
| 714 if [[ -n "$run_tests" ]]; then | 662 if [[ -n "$run_tests" ]]; then |
| 715 # Run the LLVM and Clang tests. | 663 # Run the LLVM and Clang tests. |
| 716 ninja -C "${LLVM_BUILD_DIR}" check-all | 664 ninja -C "${LLVM_BUILD_DIR}" check-all |
| 717 fi | 665 fi |
| 718 | 666 |
| 719 # After everything is done, log success for this revision. | 667 # After everything is done, log success for this revision. |
| 720 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" | 668 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" |
| OLD | NEW |