aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/compiler_wrapper.go
diff options
context:
space:
mode:
authorTobias Bosch <tbosch@google.com>2019-10-01 15:00:52 -0700
committerTobias Bosch <tbosch@google.com>2019-10-02 16:53:48 +0000
commitc88ee8a1d2c3d925a90f7a880ae085237b117454 (patch)
treee1c35815b9b354ffebe485c077e17c22099b59e2 /compiler_wrapper/compiler_wrapper.go
parent5322d4af4264a1e63fa33c732cdfb32454347a5c (diff)
downloadtoolchain-utils-c88ee8a1d2c3d925a90f7a880ae085237b117454.tar.gz
Android wrapper: Support compile with fallback.
The old android wrapper supports to use a fallback compiler in case of errors. This replicates this logic. See https://cs.corp.google.com/android/toolchain/llvm_android/compiler_wrapper.py. BUG=chromium:773875 TEST=unit test, golden tests comparing to old wrapper Change-Id: Iff7281e6e21c4834f9a4493884ed7b3d66b87967 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1833898 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'compiler_wrapper/compiler_wrapper.go')
-rw-r--r--compiler_wrapper/compiler_wrapper.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler_wrapper/compiler_wrapper.go b/compiler_wrapper/compiler_wrapper.go
index 3dec7e66..b157687f 100644
--- a/compiler_wrapper/compiler_wrapper.go
+++ b/compiler_wrapper/compiler_wrapper.go
@@ -118,6 +118,15 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int
}
return doubleBuildWithWNoError(env, cfg, compilerCmd)
}
+ if shouldCompileWithFallback(env) {
+ if rusageLogfileName != "" {
+ return 0, newUserErrorf("GETRUSAGE is meaningless with FORCE_DISABLE_WERROR")
+ }
+ if bisectStage != "" {
+ return 0, newUserErrorf("BISECT_STAGE is meaningless with FORCE_DISABLE_WERROR")
+ }
+ return compileWithFallback(env, cfg, compilerCmd, mainBuilder.absWrapperPath)
+ }
if rusageLogfileName != "" {
if bisectStage != "" {
return 0, newUserErrorf("BISECT_STAGE is meaningless with GETRUSAGE")