From 7c1b29c9a44c2554d4270b00645e6022e2ed93d4 Mon Sep 17 00:00:00 2001 From: Chris Wailes Date: Thu, 12 Oct 2023 10:56:34 -0700 Subject: Set incremental or codegen-units, not both This CL changes the handling of Rust flags to only pass one of either incremental or codegen-units. This is necessary because incremental implies a codegen-units value of 128 and it may be overridden by the separate codegen-units argument. Test: TH Change-Id: Ia474e4f9fc071d5054cb479ec9de550fa886677e --- rust/builder.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'rust/builder.go') diff --git a/rust/builder.go b/rust/builder.go index bea8ff717..fe2d03a0b 100644 --- a/rust/builder.go +++ b/rust/builder.go @@ -278,7 +278,9 @@ func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, fl if ctx.Config().IsEnvTrue("SOONG_RUSTC_INCREMENTAL") { incrementalPath := android.PathForOutput(ctx, "rustc").String() - rustcFlags = append(rustcFlags, "-Cincremental="+incrementalPath) + rustcFlags = append(rustcFlags, "-C incremental="+incrementalPath) + } else { + rustcFlags = append(rustcFlags, "-C codegen-units=1") } // Disallow experimental features -- cgit v1.2.3-59-g8ed1b