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 18 matching lines...) Expand all Loading... |
29 set -e | 29 set -e |
30 | 30 |
31 OS="$(uname -s)" | 31 OS="$(uname -s)" |
32 | 32 |
33 # Parse command line options. | 33 # Parse command line options. |
34 force_local_build= | 34 force_local_build= |
35 mac_only= | 35 mac_only= |
36 run_tests= | 36 run_tests= |
37 bootstrap= | 37 bootstrap= |
38 with_android=yes | 38 with_android=yes |
39 is_asan_mac_builder= | 39 # Temporary workaround for http://crbug.com/170629: use older Clang for ASan |
| 40 # Mac builders. |
| 41 is_asan_mac_builder_hackfix= |
40 with_tools_extra= | 42 with_tools_extra= |
41 if [[ "${OS}" = "Darwin" ]]; then | 43 if [[ "${OS}" = "Darwin" ]]; then |
42 with_android= | 44 with_android= |
43 fi | 45 fi |
44 | 46 |
45 while [[ $# > 0 ]]; do | 47 while [[ $# > 0 ]]; do |
46 case $1 in | 48 case $1 in |
47 --bootstrap) | 49 --bootstrap) |
48 bootstrap=yes | 50 bootstrap=yes |
49 ;; | 51 ;; |
50 --force-local-build) | 52 --force-local-build) |
51 force_local_build=yes | 53 force_local_build=yes |
52 ;; | 54 ;; |
53 --mac-only) | 55 --mac-only) |
54 mac_only=yes | 56 mac_only=yes |
55 ;; | 57 ;; |
56 --run-tests) | 58 --run-tests) |
57 run_tests=yes | 59 run_tests=yes |
58 ;; | 60 ;; |
59 --without-android) | 61 --without-android) |
60 with_android= | 62 with_android= |
61 ;; | 63 ;; |
62 --is-asan-mac-builder) | 64 # Temporary workaround for http://crbug.com/170629 - use older Clang for |
63 is_asan_mac_builder=yes | 65 # ASan Mac builders. |
| 66 --is-asan-mac-builder-hackfix) |
| 67 is_asan_mac_builder_hackfix=yes |
64 ;; | 68 ;; |
65 --with-tools-extra) | 69 --with-tools-extra) |
66 with_tools_extra=yes | 70 with_tools_extra=yes |
67 ;; | 71 ;; |
68 --help) | 72 --help) |
69 echo "usage: $0 [--force-local-build] [--mac-only] [--run-tests] " | 73 echo "usage: $0 [--force-local-build] [--mac-only] [--run-tests] " |
70 echo "--bootstrap: First build clang with CC, then with itself." | 74 echo "--bootstrap: First build clang with CC, then with itself." |
71 echo "--force-local-build: Don't try to download prebuilt binaries." | 75 echo "--force-local-build: Don't try to download prebuilt binaries." |
72 echo "--mac-only: Do initial download only on Mac systems." | 76 echo "--mac-only: Do initial download only on Mac systems." |
73 echo "--run-tests: Run tests after building. Only for local builds." | 77 echo "--run-tests: Run tests after building. Only for local builds." |
74 echo "--without-android: Don't build ASan Android runtime library." | 78 echo "--without-android: Don't build ASan Android runtime library." |
75 echo "--is-asan-mac-builder: Use older Clang to build ASan on Mac." | 79 echo "--is-asan-mac-builder-hackfix: Use older Clang" \ |
| 80 "to build ASan on Mac." |
76 echo "--with-tools-extra: Also build the clang-tools-extra repository." | 81 echo "--with-tools-extra: Also build the clang-tools-extra repository." |
77 exit 1 | 82 exit 1 |
78 ;; | 83 ;; |
79 esac | 84 esac |
80 shift | 85 shift |
81 done | 86 done |
82 | 87 |
83 # Are we on a Chrome buildbot running ASan? | 88 # Are we on a Chrome buildbot running ASan? |
84 function on_asan_mac_host { | 89 function on_asan_mac_host { |
85 HOST="$(uname -n)" | 90 HOST="$(uname -n)" |
86 # Chrome Mac ASan Builder. | 91 # Chrome Mac ASan Builder. |
87 if [[ "${HOST}" == "vm633-m1.golo.chromium.org" ]]; then | 92 if [[ "${HOST}" == "vm633-m1.golo.chromium.org" ]]; then |
88 return 0 | 93 return 0 |
89 fi | 94 fi |
90 # Chrome Mac ASan LKGR. | 95 # Chrome Mac ASan LKGR. |
91 if [[ "${HOST}" == "mini11-a1.golo.chromium.org" ]]; then | 96 if [[ "${HOST}" == "mini11-a1.golo.chromium.org" ]]; then |
92 return 0 | 97 return 0 |
93 fi | 98 fi |
94 # mac_asan trybots. | 99 # mac_asan trybots. |
95 for num in $(seq 600 655) | 100 for num in $(seq 600 655) |
96 do | 101 do |
97 if [[ "${HOST}" == "vm${num}-m4.golo.chromium.org" ]]; then | 102 if [[ "${HOST}" == "vm${num}-m4.golo.chromium.org" ]]; then |
98 return 0 | 103 return 0 |
99 fi | 104 fi |
100 done | 105 done |
101 return 1 | 106 return 1 |
102 } | 107 } |
103 | 108 |
104 # Use older Clang for ASan Mac builds. See http://crbug.com/170629. | 109 # Use older Clang for ASan Mac builds. See http://crbug.com/170629. |
105 if [[ -n is_asan_mac_builder ]] || on_asan_mac_host; then | 110 if [[ -n "${is_asan_mac_builder_hackfix}" ]] || on_asan_mac_host; then |
106 CLANG_REVISION=${CLANG_ASAN_MAC_REVISION} | 111 CLANG_REVISION=${CLANG_ASAN_MAC_REVISION} |
107 fi | 112 fi |
108 | 113 |
109 # --mac-only prevents the initial download on non-mac systems, but if clang has | 114 # --mac-only prevents the initial download on non-mac systems, but if clang has |
110 # already been downloaded in the past, this script keeps it up to date even if | 115 # already been downloaded in the past, this script keeps it up to date even if |
111 # --mac-only is passed in and the system isn't a mac. People who don't like this | 116 # --mac-only is passed in and the system isn't a mac. People who don't like this |
112 # can just delete their third_party/llvm-build directory. | 117 # can just delete their third_party/llvm-build directory. |
113 if [[ -n "$mac_only" ]] && [[ "${OS}" != "Darwin" ]] && | 118 if [[ -n "$mac_only" ]] && [[ "${OS}" != "Darwin" ]] && |
114 [[ ! ( "$GYP_DEFINES" =~ .*(clang|tsan|asan)=1.* ) ]] && | 119 [[ ! ( "$GYP_DEFINES" =~ .*(clang|tsan|asan)=1.* ) ]] && |
115 ! [[ -d "${LLVM_BUILD_DIR}" ]]; then | 120 ! [[ -d "${LLVM_BUILD_DIR}" ]]; then |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 # Run a few tests. | 387 # Run a few tests. |
383 PLUGIN_SRC_DIR="${THIS_DIR}/../plugins" | 388 PLUGIN_SRC_DIR="${THIS_DIR}/../plugins" |
384 "${PLUGIN_SRC_DIR}/tests/test.sh" "${LLVM_BUILD_DIR}/Release+Asserts" | 389 "${PLUGIN_SRC_DIR}/tests/test.sh" "${LLVM_BUILD_DIR}/Release+Asserts" |
385 cd "${LLVM_BUILD_DIR}" | 390 cd "${LLVM_BUILD_DIR}" |
386 make check-all | 391 make check-all |
387 cd - | 392 cd - |
388 fi | 393 fi |
389 | 394 |
390 # After everything is done, log success for this revision. | 395 # After everything is done, log success for this revision. |
391 echo "${CLANG_REVISION}" > "${STAMP_FILE}" | 396 echo "${CLANG_REVISION}" > "${STAMP_FILE}" |
OLD | NEW |