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 |
140 if [[ -n "$if_needed" ]]; then | 147 if [[ -n "$if_needed" ]]; then |
141 if [[ "${OS}" == "Darwin" ]]; then | 148 if [[ "${OS}" == "Darwin" ]]; then |
142 # clang is used on Mac. | 149 # clang is used on Mac. |
143 true | 150 true |
144 elif [[ "$GYP_DEFINES" =~ .*(clang|tsan|asan|lsan|msan)=1.* ]]; then | 151 elif [[ "$GYP_DEFINES" =~ .*(clang|tsan|asan|lsan|msan)=1.* ]]; then |
145 # clang requested via $GYP_DEFINES. | 152 # clang requested via $GYP_DEFINES. |
146 true | 153 true |
147 elif [[ -d "${LLVM_BUILD_DIR}" ]]; then | 154 elif [[ -d "${LLVM_BUILD_DIR}" ]]; then |
148 # clang previously downloaded, remove third_party/llvm-build to prevent | 155 # clang previously downloaded, remove third_party/llvm-build to prevent |
149 # updating. | 156 # updating. |
150 true | 157 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 | |
157 else | 158 else |
158 # clang wasn't needed, not doing anything. | 159 # clang wasn't needed, not doing anything. |
159 exit 0 | 160 exit 0 |
160 fi | 161 fi |
161 fi | 162 fi |
162 | 163 |
163 | 164 |
164 # Check if there's anything to be done, exit early if not. | 165 # Check if there's anything to be done, exit early if not. |
165 if [[ -f "${STAMP_FILE}" ]]; then | 166 if [[ -f "${STAMP_FILE}" ]]; then |
166 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}") | 167 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}") |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 "${TOOL_SRC_DIR}/tests/test.sh" "${LLVM_BUILD_DIR}/Release+Asserts" | 461 "${TOOL_SRC_DIR}/tests/test.sh" "${LLVM_BUILD_DIR}/Release+Asserts" |
461 fi | 462 fi |
462 done | 463 done |
463 pushd "${LLVM_BUILD_DIR}" | 464 pushd "${LLVM_BUILD_DIR}" |
464 ${MAKE} check-all | 465 ${MAKE} check-all |
465 popd | 466 popd |
466 fi | 467 fi |
467 | 468 |
468 # After everything is done, log success for this revision. | 469 # After everything is done, log success for this revision. |
469 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" | 470 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" |
OLD | NEW |