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