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

Unified Diff: build/config/compiler/BUILD.gn

Issue 3005903002: [infra] Roll clang toolchain forward (Closed)
Patch Set: Force rebuild on toolchain update Created 3 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | tools/buildtools/update.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 52256f5dfc047fb9b499b7b21741ddd01a9a1538..b7543a6398b73475a8014c808a29be967fb7b386 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.
« no previous file with comments | « DEPS ('k') | tools/buildtools/update.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698