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=253678 | 11 CLANG_REVISION=247874 |
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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 strip ${STRIP_FLAGS} bin/clang | 541 strip ${STRIP_FLAGS} bin/clang |
542 popd | 542 popd |
543 | 543 |
544 # Build compiler-rt out-of-tree. | 544 # Build compiler-rt out-of-tree. |
545 # Do a clobbered build due to cmake changes. | 545 # Do a clobbered build due to cmake changes. |
546 rm -rf "${COMPILER_RT_BUILD_DIR}" | 546 rm -rf "${COMPILER_RT_BUILD_DIR}" |
547 mkdir -p "${COMPILER_RT_BUILD_DIR}" | 547 mkdir -p "${COMPILER_RT_BUILD_DIR}" |
548 pushd "${COMPILER_RT_BUILD_DIR}" | 548 pushd "${COMPILER_RT_BUILD_DIR}" |
549 | 549 |
550 rm -fv CMakeCache.txt | 550 rm -fv CMakeCache.txt |
551 if [[ -z "${bootstrap}" ]]; then | 551 MACOSX_DEPLOYMENT_TARGET=${deployment_target} CC="" CXX="" cmake -GNinja \ |
552 # compiler_rt doesn't build with Xcode 6's clang, but not all bots have | |
553 # Xcode 7 yet. So use the just-built clang for building compiler-rt. | |
554 # However, in bootstrap builds, we delete libc++ to work around PR24068 -- so | |
555 # compiler_rt's CMake checks can't find <iostream> and decide that no arch | |
556 # is supported. So use the installed bootstrap compiler in bootstrap builds, | |
557 # it has the libc++ headers installed (CXX is already set to that in | |
558 # bootstrap builds). | |
559 CC="${ABS_LLVM_BUILD_DIR}/bin/clang" | |
560 CXX="${ABS_LLVM_BUILD_DIR}/bin/clang++" | |
561 elif [[ "${OS}" = "Darwin" ]]; then | |
562 # ...except that compiler-rt currently doesn't build with the bootstrap | |
563 # compiler on Darwin either! So use the system compiler there. | |
564 # TOOD(thakis): Remove this once http://llvm.org/PR25465 is fixed. | |
565 CC=cc | |
566 CXX=c++ | |
567 fi | |
568 MACOSX_DEPLOYMENT_TARGET=${deployment_target} cmake -GNinja \ | |
569 -DCMAKE_BUILD_TYPE=Release \ | 552 -DCMAKE_BUILD_TYPE=Release \ |
570 -DLLVM_ENABLE_ASSERTIONS=ON \ | 553 -DLLVM_ENABLE_ASSERTIONS=ON \ |
571 -DLLVM_ENABLE_THREADS=OFF \ | 554 -DLLVM_ENABLE_THREADS=OFF \ |
572 -DCMAKE_C_COMPILER="${CC}" \ | 555 -DCMAKE_C_COMPILER="${ABS_LLVM_BUILD_DIR}/bin/clang" \ |
573 -DCMAKE_CXX_COMPILER="${CXX}" \ | 556 -DCMAKE_CXX_COMPILER="${ABS_LLVM_BUILD_DIR}/bin/clang++" \ |
574 -DSANITIZER_MIN_OSX_VERSION="10.7" \ | 557 -DSANITIZER_MIN_OSX_VERSION="10.7" \ |
575 -DLLVM_CONFIG_PATH="${ABS_LLVM_BUILD_DIR}/bin/llvm-config" \ | 558 -DLLVM_CONFIG_PATH="${ABS_LLVM_BUILD_DIR}/bin/llvm-config" \ |
576 "${ABS_COMPILER_RT_DIR}" | 559 "${ABS_COMPILER_RT_DIR}" |
577 | 560 |
578 ninja | 561 ninja |
579 | 562 |
580 # Copy selected output to the main tree. | 563 # Copy selected output to the main tree. |
581 # Darwin doesn't support cp --parents, so pipe through tar instead. | 564 # Darwin doesn't support cp --parents, so pipe through tar instead. |
582 CLANG_VERSION=$("${ABS_LLVM_BUILD_DIR}/bin/clang" --version | \ | 565 CLANG_VERSION=$("${ABS_LLVM_BUILD_DIR}/bin/clang" --version | \ |
583 sed -ne 's/clang version \([0-9]\.[0-9]\.[0-9]\).*/\1/p') | 566 sed -ne 's/clang version \([0-9]\.[0-9]\.[0-9]\).*/\1/p') |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 # Run Chrome tool tests. | 632 # Run Chrome tool tests. |
650 ninja -C "${LLVM_BUILD_DIR}" cr-check-all | 633 ninja -C "${LLVM_BUILD_DIR}" cr-check-all |
651 fi | 634 fi |
652 if [[ -n "$run_tests" ]]; then | 635 if [[ -n "$run_tests" ]]; then |
653 # Run the LLVM and Clang tests. | 636 # Run the LLVM and Clang tests. |
654 ninja -C "${LLVM_BUILD_DIR}" check-all | 637 ninja -C "${LLVM_BUILD_DIR}" check-all |
655 fi | 638 fi |
656 | 639 |
657 # After everything is done, log success for this revision. | 640 # After everything is done, log success for this revision. |
658 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" | 641 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" |
OLD | NEW |