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=216630 | 11 CLANG_REVISION=217949 |
12 | 12 |
13 THIS_DIR="$(dirname "${0}")" | 13 THIS_DIR="$(dirname "${0}")" |
14 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" | 14 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" |
15 LLVM_BUILD_DIR="${LLVM_DIR}/../llvm-build/Release+Asserts" | 15 LLVM_BUILD_DIR="${LLVM_DIR}/../llvm-build/Release+Asserts" |
16 COMPILER_RT_BUILD_DIR="${LLVM_DIR}/../llvm-build/compiler-rt" | 16 COMPILER_RT_BUILD_DIR="${LLVM_DIR}/../llvm-build/compiler-rt" |
17 LLVM_BOOTSTRAP_DIR="${LLVM_DIR}/../llvm-bootstrap" | 17 LLVM_BOOTSTRAP_DIR="${LLVM_DIR}/../llvm-bootstrap" |
18 LLVM_BOOTSTRAP_INSTALL_DIR="${LLVM_DIR}/../llvm-bootstrap-install" | 18 LLVM_BOOTSTRAP_INSTALL_DIR="${LLVM_DIR}/../llvm-bootstrap-install" |
19 CLANG_DIR="${LLVM_DIR}/tools/clang" | 19 CLANG_DIR="${LLVM_DIR}/tools/clang" |
20 COMPILER_RT_DIR="${LLVM_DIR}/compiler-rt" | 20 COMPILER_RT_DIR="${LLVM_DIR}/compiler-rt" |
21 LIBCXX_DIR="${LLVM_DIR}/projects/libcxx" | 21 LIBCXX_DIR="${LLVM_DIR}/projects/libcxx" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 # Check that cmake and ninja are available. | 220 # Check that cmake and ninja are available. |
221 if ! which cmake > /dev/null; then | 221 if ! which cmake > /dev/null; then |
222 echo "CMake needed to build clang; please install" | 222 echo "CMake needed to build clang; please install" |
223 exit 1 | 223 exit 1 |
224 fi | 224 fi |
225 if ! which ninja > /dev/null; then | 225 if ! which ninja > /dev/null; then |
226 echo "ninja needed to build clang, please install" | 226 echo "ninja needed to build clang, please install" |
227 exit 1 | 227 exit 1 |
228 fi | 228 fi |
229 | 229 |
| 230 echo Reverting previously patched files |
| 231 for i in \ |
| 232 "${CLANG_DIR}/test/Index/crash-recovery-modules.m" \ |
| 233 "${CLANG_DIR}/unittests/libclang/LibclangTest.cpp" \ |
| 234 "${COMPILER_RT_DIR}/lib/asan/asan_rtl.cc" \ |
| 235 "${COMPILER_RT_DIR}/test/asan/TestCases/Linux/new_array_cookie_test.cc" \ |
| 236 ; do |
| 237 if [[ -e "${i}" ]]; then |
| 238 svn revert "${i}" |
| 239 fi; |
| 240 done |
| 241 |
230 echo Getting LLVM r"${CLANG_REVISION}" in "${LLVM_DIR}" | 242 echo Getting LLVM r"${CLANG_REVISION}" in "${LLVM_DIR}" |
231 if ! svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" \ | 243 if ! svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" \ |
232 "${LLVM_DIR}"; then | 244 "${LLVM_DIR}"; then |
233 echo Checkout failed, retrying | 245 echo Checkout failed, retrying |
234 rm -rf "${LLVM_DIR}" | 246 rm -rf "${LLVM_DIR}" |
235 svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" "${LLVM_DIR}" | 247 svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" "${LLVM_DIR}" |
236 fi | 248 fi |
237 | 249 |
238 echo Getting clang r"${CLANG_REVISION}" in "${CLANG_DIR}" | 250 echo Getting clang r"${CLANG_REVISION}" in "${CLANG_DIR}" |
239 svn co --force "${LLVM_REPO_URL}/cfe/trunk@${CLANG_REVISION}" "${CLANG_DIR}" | 251 svn co --force "${LLVM_REPO_URL}/cfe/trunk@${CLANG_REVISION}" "${CLANG_DIR}" |
(...skipping 17 matching lines...) Expand all Loading... |
257 # While we're bundling our own libc++ on OS X, we need to compile libc++abi | 269 # While we're bundling our own libc++ on OS X, we need to compile libc++abi |
258 # into it too (since OS X 10.6 doesn't have libc++abi.dylib either). | 270 # into it too (since OS X 10.6 doesn't have libc++abi.dylib either). |
259 if [ "${OS}" = "Darwin" ]; then | 271 if [ "${OS}" = "Darwin" ]; then |
260 echo Getting libc++abi r"${CLANG_REVISION}" in "${LIBCXXABI_DIR}" | 272 echo Getting libc++abi r"${CLANG_REVISION}" in "${LIBCXXABI_DIR}" |
261 svn co --force "${LLVM_REPO_URL}/libcxxabi/trunk@${CLANG_REVISION}" \ | 273 svn co --force "${LLVM_REPO_URL}/libcxxabi/trunk@${CLANG_REVISION}" \ |
262 "${LIBCXXABI_DIR}" | 274 "${LIBCXXABI_DIR}" |
263 fi | 275 fi |
264 | 276 |
265 # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974) | 277 # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974) |
266 pushd "${CLANG_DIR}" | 278 pushd "${CLANG_DIR}" |
267 svn revert test/Index/crash-recovery-modules.m | |
268 cat << 'EOF' | | 279 cat << 'EOF' | |
269 --- third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (revisio
n 202554) | 280 --- third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (revisio
n 202554) |
270 +++ third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (working
copy) | 281 +++ third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (working
copy) |
271 @@ -12,6 +12,8 @@ | 282 @@ -12,6 +12,8 @@ |
272 | 283 |
273 // REQUIRES: crash-recovery | 284 // REQUIRES: crash-recovery |
274 // REQUIRES: shell | 285 // REQUIRES: shell |
275 +// XFAIL: * | 286 +// XFAIL: * |
276 +// (PR11974) | 287 +// (PR11974) |
277 | 288 |
278 @import Crash; | 289 @import Crash; |
279 EOF | 290 EOF |
280 patch -p4 | 291 patch -p4 |
281 popd | 292 popd |
282 | 293 |
283 pushd "${CLANG_DIR}" | 294 pushd "${CLANG_DIR}" |
284 svn revert unittests/libclang/LibclangTest.cpp | |
285 cat << 'EOF' | | 295 cat << 'EOF' | |
286 --- unittests/libclang/LibclangTest.cpp (revision 215949) | 296 --- unittests/libclang/LibclangTest.cpp (revision 215949) |
287 +++ unittests/libclang/LibclangTest.cpp (working copy) | 297 +++ unittests/libclang/LibclangTest.cpp (working copy) |
288 @@ -431,7 +431,7 @@ | 298 @@ -431,7 +431,7 @@ |
289 EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU)); | 299 EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU)); |
290 } | 300 } |
291 | 301 |
292 -TEST_F(LibclangReparseTest, ReparseWithModule) { | 302 -TEST_F(LibclangReparseTest, ReparseWithModule) { |
293 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) { | 303 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) { |
294 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;"; | 304 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;"; |
295 const char *HeaderBottom = "\n};\n#endif\n"; | 305 const char *HeaderBottom = "\n};\n#endif\n"; |
296 const char *MFile = "#include \"HeaderFile.h\"\nint main() {" | 306 const char *MFile = "#include \"HeaderFile.h\"\nint main() {" |
297 EOF | 307 EOF |
298 patch -p0 | 308 patch -p0 |
299 popd | 309 popd |
300 | 310 |
301 # Apply r216684 to fix ASan array cookie instrumentation problem. | |
302 # (See https://code.google.com/p/chromium/issues/detail?id=400849#c17) | |
303 pushd "${COMPILER_RT_DIR}" | |
304 svn revert lib/asan/asan_rtl.cc | |
305 svn revert test/asan/TestCases/Linux/new_array_cookie_test.cc | |
306 cat << 'EOF' | | |
307 --- a/lib/asan/asan_rtl.cc | |
308 +++ b/lib/asan/asan_rtl.cc | |
309 @@ -269,7 +269,7 @@ void InitializeFlags(Flags *f, const char *env) { | |
310 f->allow_reexec = true; | |
311 f->print_full_thread_history = true; | |
312 f->poison_heap = true; | |
313 - f->poison_array_cookie = true; | |
314 + f->poison_array_cookie = false; | |
315 f->poison_partial = true; | |
316 // Turn off alloc/dealloc mismatch checker on Mac and Windows for now. | |
317 // https://code.google.com/p/address-sanitizer/issues/detail?id=131 | |
318 diff --git a/test/asan/TestCases/Linux/new_array_cookie_test.cc b/test/asan/Test
Cases/Linux/new_array_cookie_test.cc | |
319 index 339120b..49545f0 100644 | |
320 --- a/test/asan/TestCases/Linux/new_array_cookie_test.cc | |
321 +++ b/test/asan/TestCases/Linux/new_array_cookie_test.cc | |
322 @@ -1,6 +1,6 @@ | |
323 // REQUIRES: asan-64-bits | |
324 -// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s | |
325 -// RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s | |
326 +// RUN: %clangxx_asan -O3 %s -o %t | |
327 +// RUN %run %t | |
328 // RUN: ASAN_OPTIONS=poison_array_cookie=1 not %run %t 2>&1 | FileCheck %s | |
329 // RUN: ASAN_OPTIONS=poison_array_cookie=0 %run %t | |
330 #include <stdio.h> | |
331 EOF | |
332 patch -p1 | |
333 popd | |
334 | |
335 # Echo all commands. | 311 # Echo all commands. |
336 set -x | 312 set -x |
337 | 313 |
338 # Set default values for CC and CXX if they're not set in the environment. | 314 # Set default values for CC and CXX if they're not set in the environment. |
339 CC=${CC:-cc} | 315 CC=${CC:-cc} |
340 CXX=${CXX:-c++} | 316 CXX=${CXX:-c++} |
341 | 317 |
342 if [[ -n "${gcc_toolchain}" ]]; then | 318 if [[ -n "${gcc_toolchain}" ]]; then |
343 # Use the specified gcc installation for building. | 319 # Use the specified gcc installation for building. |
344 CC="$gcc_toolchain/bin/gcc" | 320 CC="$gcc_toolchain/bin/gcc" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 | 555 |
580 if [[ -n "$run_tests" ]]; then | 556 if [[ -n "$run_tests" ]]; then |
581 # Run Chrome tool tests. | 557 # Run Chrome tool tests. |
582 ninja -C "${TOOL_BUILD_DIR}" check-all | 558 ninja -C "${TOOL_BUILD_DIR}" check-all |
583 # Run the LLVM and Clang tests. | 559 # Run the LLVM and Clang tests. |
584 ninja -C "${LLVM_BUILD_DIR}" check-all | 560 ninja -C "${LLVM_BUILD_DIR}" check-all |
585 fi | 561 fi |
586 | 562 |
587 # After everything is done, log success for this revision. | 563 # After everything is done, log success for this revision. |
588 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" | 564 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" |
OLD | NEW |