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

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

Issue 1373043003: 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|use_lto|use_lto_o2|official_build)=1.* ]]; t hen
scottmg 2015/09/28 22:09:41 Is "official_build=1" how CrOS does it? On Windows
hans 2015/09/28 22:11:04 Seems like a lot of different options :-/ Can you
Nico 2015/10/08 02:27:24 Yeah, I think you need buildtype=Official (and may
krasin 2015/10/09 21:33:51 Done in https://codereview.chromium.org/1385403006
57 # LLVM Gold plugin is required to build with this configuration
hans 2015/09/28 22:11:04 ultra nit: period at the end of the comment.
krasin 2015/10/01 21:07:46 Done.
58 LLVM_DOWNLOAD_GOLD_PLUGIN=1
59 fi
56 60
57 # Die if any command dies, error on undefined variable expansions. 61 # Die if any command dies, error on undefined variable expansions.
58 set -eu 62 set -eu
59 63
60 64
61 if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then 65 if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then
62 # Use a real revision number rather than HEAD to make sure that the stamp file 66 # Use a real revision number rather than HEAD to make sure that the stamp file
63 # logic works. 67 # logic works.
64 CLANG_REVISION=$(svn info "$LLVM_REPO_URL" \ 68 CLANG_REVISION=$(svn info "$LLVM_REPO_URL" \
65 | grep 'Revision:' | awk '{ printf $2; }') 69 | grep 'Revision:' | awk '{ printf $2; }')
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 fi 232 fi
229 233
230 234
231 # Check if there's anything to be done, exit early if not. 235 # Check if there's anything to be done, exit early if not.
232 if [[ -f "${STAMP_FILE}" ]]; then 236 if [[ -f "${STAMP_FILE}" ]]; then
233 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}") 237 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}")
234 if [[ -z "$force_local_build" ]] && \ 238 if [[ -z "$force_local_build" ]] && \
235 [[ "${PREVIOUSLY_BUILT_REVISON}" = \ 239 [[ "${PREVIOUSLY_BUILT_REVISON}" = \
236 "${PACKAGE_VERSION}" ]]; then 240 "${PACKAGE_VERSION}" ]]; then
237 echo "Clang already at ${PACKAGE_VERSION}" 241 echo "Clang already at ${PACKAGE_VERSION}"
242 if [[ -n "${LLVM_DOWNLOAD_GOLD_PLUGIN}" ]]; then
hans 2015/09/28 22:11:04 The code below (line 285) already downloads the go
krasin 2015/10/09 21:33:51 Good idea. Done in https://codereview.chromium.org
243 # TODO(krasin): make a stamp for gold plugin to avoid
244 # downloading it every time.
245 ${THIS_DIR}/../../../build/download_gold_plugin.py
246 fi
238 exit 0 247 exit 0
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.
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 # Run Chrome tool tests. 669 # Run Chrome tool tests.
661 ninja -C "${LLVM_BUILD_DIR}" cr-check-all 670 ninja -C "${LLVM_BUILD_DIR}" cr-check-all
662 fi 671 fi
663 if [[ -n "$run_tests" ]]; then 672 if [[ -n "$run_tests" ]]; then
664 # Run the LLVM and Clang tests. 673 # Run the LLVM and Clang tests.
665 ninja -C "${LLVM_BUILD_DIR}" check-all 674 ninja -C "${LLVM_BUILD_DIR}" check-all
666 fi 675 fi
667 676
668 # After everything is done, log success for this revision. 677 # After everything is done, log success for this revision.
669 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" 678 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