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. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 ;; | 130 ;; |
131 *) | 131 *) |
132 echo "Unknown argument: '$1'." | 132 echo "Unknown argument: '$1'." |
133 echo "Use --help for help." | 133 echo "Use --help for help." |
134 exit 1 | 134 exit 1 |
135 ;; | 135 ;; |
136 esac | 136 esac |
137 shift | 137 shift |
138 done | 138 done |
139 | 139 |
140 # Remove clang on bots where it was autoinstalled in r281914. | |
141 if [[ -f "${LLVM_BUILD_DIR}/autoinstall_stamp" ]]; then | |
142 echo Removing autoinstalled clang and clobbering | |
143 rm -rf "${LLVM_BUILD_DIR}" | |
144 rm -rf "${THIS_DIR}/../../../out" | |
145 fi | |
146 | |
147 if [[ -n "$if_needed" ]]; then | 140 if [[ -n "$if_needed" ]]; then |
148 if [[ "${OS}" == "Darwin" ]]; then | 141 if [[ "${OS}" == "Darwin" ]]; then |
149 # clang is used on Mac. | 142 # clang is used on Mac. |
150 true | 143 true |
151 elif [[ "$GYP_DEFINES" =~ .*(clang|tsan|asan|lsan|msan)=1.* ]]; then | 144 elif [[ "$GYP_DEFINES" =~ .*(clang|tsan|asan|lsan|msan)=1.* ]]; then |
152 # clang requested via $GYP_DEFINES. | 145 # clang requested via $GYP_DEFINES. |
153 true | 146 true |
154 elif [[ -d "${LLVM_BUILD_DIR}" ]]; then | 147 elif [[ -d "${LLVM_BUILD_DIR}" ]]; then |
155 # clang previously downloaded, remove third_party/llvm-build to prevent | 148 # clang previously downloaded, remove third_party/llvm-build to prevent |
156 # updating. | 149 # updating. |
157 true | 150 true |
| 151 elif [[ "${OS}" == "Linux" ]]; then |
| 152 # Temporarily use clang on linux. Leave a stamp file behind, so that |
| 153 # this script can remove clang again on machines where it was autoinstalled. |
| 154 mkdir -p "${LLVM_BUILD_DIR}" |
| 155 touch "${LLVM_BUILD_DIR}/autoinstall_stamp" |
| 156 true |
158 else | 157 else |
159 # clang wasn't needed, not doing anything. | 158 # clang wasn't needed, not doing anything. |
160 exit 0 | 159 exit 0 |
161 fi | 160 fi |
162 fi | 161 fi |
163 | 162 |
164 | 163 |
165 # Check if there's anything to be done, exit early if not. | 164 # Check if there's anything to be done, exit early if not. |
166 if [[ -f "${STAMP_FILE}" ]]; then | 165 if [[ -f "${STAMP_FILE}" ]]; then |
167 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}") | 166 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}") |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 "${TOOL_SRC_DIR}/tests/test.sh" "${LLVM_BUILD_DIR}/Release+Asserts" | 460 "${TOOL_SRC_DIR}/tests/test.sh" "${LLVM_BUILD_DIR}/Release+Asserts" |
462 fi | 461 fi |
463 done | 462 done |
464 pushd "${LLVM_BUILD_DIR}" | 463 pushd "${LLVM_BUILD_DIR}" |
465 ${MAKE} check-all | 464 ${MAKE} check-all |
466 popd | 465 popd |
467 fi | 466 fi |
468 | 467 |
469 # After everything is done, log success for this revision. | 468 # After everything is done, log success for this revision. |
470 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" | 469 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" |
OLD | NEW |