From a60fb341f51a37b52ce5bb9981fa405d67e4c076 Mon Sep 17 00:00:00 2001 From: Zach Anderson Date: Thu, 31 Aug 2017 21:49:01 -0700 Subject: [PATCH] [infra] Roll clang toolchain forward This is to match the version used by Flutter. R=asiva@google.com, rmacnak@google.com Review-Url: https://codereview.chromium.org/3005903002 . --- DEPS | 2 +- build/config/compiler/BUILD.gn | 14 ++++++++++++++ tools/buildtools/update.py | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ac8c2325b69..5137bbc4b9d 100644 --- a/DEPS +++ b/DEPS @@ -36,7 +36,7 @@ vars = { # Revisions of GN related dependencies. This should match the revision # pulled by Flutter. - "buildtools_revision": "@057ef89874e3c622248cf99259434fdc683c4e30", + "buildtools_revision": "@5b8eb38aaf523f0124756454276cd0a5b720c17e", # Scripts that make 'git cl format' work. "clang_format_scripts_rev": "@c09c8deeac31f05bd801995c475e7c8070f9ecda", diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 52256f5dfc0..b7543a6398b 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -329,6 +329,20 @@ config("compiler") { } } + # We want to force a recompile and relink of the world whenever our toolchain + # changes since artifacts from an older version of the toolchain may or may + # not be compatible with newer ones. To achieve this, we insert a synthetic + # define into the compile line. + if (is_clang && (is_linux || is_mac)) { + if (is_linux) { + toolchain_stamp_file = "//buildtools/linux64/toolchain.stamp" + } else { + toolchain_stamp_file = "//buildtools/mac/toolchain.stamp" + } + toolchain_version = read_file(toolchain_stamp_file, "trim string") + defines = [ "TOOLCHAIN_VERSION=$toolchain_version" ] + } + # Assign any flags set for the C compiler to asmflags so that they are sent # to the assembler. The Windows assembler takes different types of flags # so only do so for posix platforms. diff --git a/tools/buildtools/update.py b/tools/buildtools/update.py index 2f9b4b8a8b1..cea1917152f 100755 --- a/tools/buildtools/update.py +++ b/tools/buildtools/update.py @@ -24,7 +24,7 @@ DEPOT_PATH = find_depot_tools.add_depot_tools_to_path() def Update(): path = os.path.join(BUILDTOOLS, 'update.sh') - command = ['/bin/bash', path, '--toolchain', '--gn'] + command = ['/bin/bash', path, '--clang', '--gn'] return subprocess.call(command, cwd=DART_ROOT)