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