Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: tools/clang/scripts/update.sh

Issue 1385403006: CFI: download LLVM Gold plugin, if requested by env var or GYP_DEFINES. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 if [[ -z "$GYP_DEFINES" ]]; then 46 if [[ -z "$GYP_DEFINES" ]]; then
47 GYP_DEFINES= 47 GYP_DEFINES=
48 fi 48 fi
49 if [[ -z "$GYP_GENERATORS" ]]; then 49 if [[ -z "$GYP_GENERATORS" ]]; then
50 GYP_GENERATORS= 50 GYP_GENERATORS=
51 fi 51 fi
52 if [[ -z "$LLVM_DOWNLOAD_GOLD_PLUGIN" ]]; then 52 if [[ -z "$LLVM_DOWNLOAD_GOLD_PLUGIN" ]]; then
53 LLVM_DOWNLOAD_GOLD_PLUGIN= 53 LLVM_DOWNLOAD_GOLD_PLUGIN=
54 fi 54 fi
55 55
56 if [[ "$GYP_DEFINES" =~ .*cfi_vptr=1.* ]] || \
hans 2015/10/09 21:42:48 Doesn't this still need to be guarded by "if Linux
krasin 2015/10/09 21:50:18 Done.
57 [[ "$GYP_DEFINES" =~ .*buildtype=Official.* ]] || \
58 [[ "$GYP_DEFINES" =~ .*branding=Chrome.* ]] ; then
Nico 2015/10/09 21:40:10 Let's do the same as https://code.google.com/p/chr
krasin 2015/10/09 21:50:18 Done.
59 # LLVM Gold plugin is required to build with this configuration.
60 LLVM_DOWNLOAD_GOLD_PLUGIN=1
61 fi
56 62
57 # Die if any command dies, error on undefined variable expansions. 63 # Die if any command dies, error on undefined variable expansions.
58 set -eu 64 set -eu
59 65
60 66
61 if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then 67 if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then
62 # Use a real revision number rather than HEAD to make sure that the stamp file 68 # Use a real revision number rather than HEAD to make sure that the stamp file
63 # logic works. 69 # logic works.
64 CLANG_REVISION=$(svn info "$LLVM_REPO_URL" \ 70 CLANG_REVISION=$(svn info "$LLVM_REPO_URL" \
65 | grep 'Revision:' | awk '{ printf $2; }') 71 | grep 'Revision:' | awk '{ printf $2; }')
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 fi 234 fi
229 235
230 236
231 # Check if there's anything to be done, exit early if not. 237 # Check if there's anything to be done, exit early if not.
232 if [[ -f "${STAMP_FILE}" ]]; then 238 if [[ -f "${STAMP_FILE}" ]]; then
233 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}") 239 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}")
234 if [[ -z "$force_local_build" ]] && \ 240 if [[ -z "$force_local_build" ]] && \
235 [[ "${PREVIOUSLY_BUILT_REVISON}" = \ 241 [[ "${PREVIOUSLY_BUILT_REVISON}" = \
236 "${PACKAGE_VERSION}" ]]; then 242 "${PACKAGE_VERSION}" ]]; then
237 echo "Clang already at ${PACKAGE_VERSION}" 243 echo "Clang already at ${PACKAGE_VERSION}"
238 exit 0 244 if [[ -z "${LLVM_DOWNLOAD_GOLD_PLUGIN}" ]] || \
245 [[ -f "${LLVM_BUILD_DIR}/lib/LLVMgold.so" ]]; then
Nico 2015/10/09 21:40:10 with this setup it can theoretically happen that a
krasin 2015/10/09 21:50:18 I raised this point, Hans correctly pointed out th
Nico 2015/10/09 21:52:37 Smart guy, that Hans!
246 exit 0
247 fi
239 fi 248 fi
240 fi 249 fi
241 # To always force a new build if someone interrupts their build half way. 250 # To always force a new build if someone interrupts their build half way.
242 rm -f "${STAMP_FILE}" 251 rm -f "${STAMP_FILE}"
243 252
244 253
245 if [[ -z "$force_local_build" ]]; then 254 if [[ -z "$force_local_build" ]]; then
246 # Check if there's a prebuilt binary and if so just fetch that. That's faster, 255 # Check if there's a prebuilt binary and if so just fetch that. That's faster,
247 # and goma relies on having matching binary hashes on client and server too. 256 # and goma relies on having matching binary hashes on client and server too.
248 CDS_FILE="clang-${PACKAGE_VERSION}.tgz" 257 CDS_FILE="clang-${PACKAGE_VERSION}.tgz"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 # Run Chrome tool tests. 671 # Run Chrome tool tests.
663 ninja -C "${LLVM_BUILD_DIR}" cr-check-all 672 ninja -C "${LLVM_BUILD_DIR}" cr-check-all
664 fi 673 fi
665 if [[ -n "$run_tests" ]]; then 674 if [[ -n "$run_tests" ]]; then
666 # Run the LLVM and Clang tests. 675 # Run the LLVM and Clang tests.
667 ninja -C "${LLVM_BUILD_DIR}" check-all 676 ninja -C "${LLVM_BUILD_DIR}" check-all
668 fi 677 fi
669 678
670 # After everything is done, log success for this revision. 679 # After everything is done, log success for this revision.
671 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" 680 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698