diff options
author | 2021-10-25 15:37:43 -0700 | |
---|---|---|
committer | 2021-10-25 22:44:55 +0000 | |
commit | f77913f0de53fe8fb24854bc90356b3f874ea983 (patch) | |
tree | f1c9090a3db6eeba6a89d9547273d7e1b83e84e5 /rust/builder.go | |
parent | 85d72973187ddedf65f509d51ca11c70e19655f9 (diff) |
[rust] Switch LTO flavor to "thin"
Bug: http://b/202032071
Thin LTO provides similar performance gains to full LTO but takes less
time during build.
Thin LTO also doesn't cause the error with `-C lto` and `-C
llvm-args=--runtime-counter-relocation` in b/202032071.
Test: presubmit
Test: verify b/202032071
Change-Id: Id5749aaea598d4b555a9d959ed753a312ae36f26
Diffstat (limited to 'rust/builder.go')
-rw-r--r-- | rust/builder.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rust/builder.go b/rust/builder.go index 426a569bf..f79cf9b12 100644 --- a/rust/builder.go +++ b/rust/builder.go @@ -95,7 +95,7 @@ func init() { func TransformSrcToBinary(ctx ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags, outputFile android.WritablePath) buildOutput { - flags.GlobalRustFlags = append(flags.GlobalRustFlags, "-C lto") + flags.GlobalRustFlags = append(flags.GlobalRustFlags, "-C lto=thin") return transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "bin") } @@ -112,13 +112,13 @@ func TransformSrctoDylib(ctx ModuleContext, mainSrc android.Path, deps PathDeps, func TransformSrctoStatic(ctx ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags, outputFile android.WritablePath) buildOutput { - flags.GlobalRustFlags = append(flags.GlobalRustFlags, "-C lto") + flags.GlobalRustFlags = append(flags.GlobalRustFlags, "-C lto=thin") return transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "staticlib") } func TransformSrctoShared(ctx ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags, outputFile android.WritablePath) buildOutput { - flags.GlobalRustFlags = append(flags.GlobalRustFlags, "-C lto") + flags.GlobalRustFlags = append(flags.GlobalRustFlags, "-C lto=thin") return transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "cdylib") } |