| 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=217949 | 11 CLANG_REVISION=216630 |
| 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 | |
| 242 echo Getting LLVM r"${CLANG_REVISION}" in "${LLVM_DIR}" | 230 echo Getting LLVM r"${CLANG_REVISION}" in "${LLVM_DIR}" |
| 243 if ! svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" \ | 231 if ! svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" \ |
| 244 "${LLVM_DIR}"; then | 232 "${LLVM_DIR}"; then |
| 245 echo Checkout failed, retrying | 233 echo Checkout failed, retrying |
| 246 rm -rf "${LLVM_DIR}" | 234 rm -rf "${LLVM_DIR}" |
| 247 svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" "${LLVM_DIR}" | 235 svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" "${LLVM_DIR}" |
| 248 fi | 236 fi |
| 249 | 237 |
| 250 echo Getting clang r"${CLANG_REVISION}" in "${CLANG_DIR}" | 238 echo Getting clang r"${CLANG_REVISION}" in "${CLANG_DIR}" |
| 251 svn co --force "${LLVM_REPO_URL}/cfe/trunk@${CLANG_REVISION}" "${CLANG_DIR}" | 239 svn co --force "${LLVM_REPO_URL}/cfe/trunk@${CLANG_REVISION}" "${CLANG_DIR}" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 269 # While we're bundling our own libc++ on OS X, we need to compile libc++abi | 257 # While we're bundling our own libc++ on OS X, we need to compile libc++abi |
| 270 # into it too (since OS X 10.6 doesn't have libc++abi.dylib either). | 258 # into it too (since OS X 10.6 doesn't have libc++abi.dylib either). |
| 271 if [ "${OS}" = "Darwin" ]; then | 259 if [ "${OS}" = "Darwin" ]; then |
| 272 echo Getting libc++abi r"${CLANG_REVISION}" in "${LIBCXXABI_DIR}" | 260 echo Getting libc++abi r"${CLANG_REVISION}" in "${LIBCXXABI_DIR}" |
| 273 svn co --force "${LLVM_REPO_URL}/libcxxabi/trunk@${CLANG_REVISION}" \ | 261 svn co --force "${LLVM_REPO_URL}/libcxxabi/trunk@${CLANG_REVISION}" \ |
| 274 "${LIBCXXABI_DIR}" | 262 "${LIBCXXABI_DIR}" |
| 275 fi | 263 fi |
| 276 | 264 |
| 277 # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974) | 265 # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974) |
| 278 pushd "${CLANG_DIR}" | 266 pushd "${CLANG_DIR}" |
| 267 svn revert test/Index/crash-recovery-modules.m |
| 279 cat << 'EOF' | | 268 cat << 'EOF' | |
| 280 --- third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (revisio
n 202554) | 269 --- third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (revisio
n 202554) |
| 281 +++ third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (working
copy) | 270 +++ third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (working
copy) |
| 282 @@ -12,6 +12,8 @@ | 271 @@ -12,6 +12,8 @@ |
| 283 | 272 |
| 284 // REQUIRES: crash-recovery | 273 // REQUIRES: crash-recovery |
| 285 // REQUIRES: shell | 274 // REQUIRES: shell |
| 286 +// XFAIL: * | 275 +// XFAIL: * |
| 287 +// (PR11974) | 276 +// (PR11974) |
| 288 | 277 |
| 289 @import Crash; | 278 @import Crash; |
| 290 EOF | 279 EOF |
| 291 patch -p4 | 280 patch -p4 |
| 292 popd | 281 popd |
| 293 | 282 |
| 294 pushd "${CLANG_DIR}" | 283 pushd "${CLANG_DIR}" |
| 284 svn revert unittests/libclang/LibclangTest.cpp |
| 295 cat << 'EOF' | | 285 cat << 'EOF' | |
| 296 --- unittests/libclang/LibclangTest.cpp (revision 215949) | 286 --- unittests/libclang/LibclangTest.cpp (revision 215949) |
| 297 +++ unittests/libclang/LibclangTest.cpp (working copy) | 287 +++ unittests/libclang/LibclangTest.cpp (working copy) |
| 298 @@ -431,7 +431,7 @@ | 288 @@ -431,7 +431,7 @@ |
| 299 EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU)); | 289 EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU)); |
| 300 } | 290 } |
| 301 | 291 |
| 302 -TEST_F(LibclangReparseTest, ReparseWithModule) { | 292 -TEST_F(LibclangReparseTest, ReparseWithModule) { |
| 303 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) { | 293 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) { |
| 304 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;"; | 294 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;"; |
| 305 const char *HeaderBottom = "\n};\n#endif\n"; | 295 const char *HeaderBottom = "\n};\n#endif\n"; |
| 306 const char *MFile = "#include \"HeaderFile.h\"\nint main() {" | 296 const char *MFile = "#include \"HeaderFile.h\"\nint main() {" |
| 307 EOF | 297 EOF |
| 308 patch -p0 | 298 patch -p0 |
| 309 popd | 299 popd |
| 310 | 300 |
| 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 |
| 311 # Echo all commands. | 335 # Echo all commands. |
| 312 set -x | 336 set -x |
| 313 | 337 |
| 314 # Set default values for CC and CXX if they're not set in the environment. | 338 # Set default values for CC and CXX if they're not set in the environment. |
| 315 CC=${CC:-cc} | 339 CC=${CC:-cc} |
| 316 CXX=${CXX:-c++} | 340 CXX=${CXX:-c++} |
| 317 | 341 |
| 318 if [[ -n "${gcc_toolchain}" ]]; then | 342 if [[ -n "${gcc_toolchain}" ]]; then |
| 319 # Use the specified gcc installation for building. | 343 # Use the specified gcc installation for building. |
| 320 CC="$gcc_toolchain/bin/gcc" | 344 CC="$gcc_toolchain/bin/gcc" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 | 579 |
| 556 if [[ -n "$run_tests" ]]; then | 580 if [[ -n "$run_tests" ]]; then |
| 557 # Run Chrome tool tests. | 581 # Run Chrome tool tests. |
| 558 ninja -C "${TOOL_BUILD_DIR}" check-all | 582 ninja -C "${TOOL_BUILD_DIR}" check-all |
| 559 # Run the LLVM and Clang tests. | 583 # Run the LLVM and Clang tests. |
| 560 ninja -C "${LLVM_BUILD_DIR}" check-all | 584 ninja -C "${LLVM_BUILD_DIR}" check-all |
| 561 fi | 585 fi |
| 562 | 586 |
| 563 # After everything is done, log success for this revision. | 587 # After everything is done, log success for this revision. |
| 564 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" | 588 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" |
| OLD | NEW |