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
This commit is contained in:
@@ -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
|
||||
|
@@ -44,7 +44,6 @@ var (
|
||||
GlobalRustFlags = []string{
|
||||
"-Z stack-protector=strong",
|
||||
"-Z remap-cwd-prefix=.",
|
||||
"-C codegen-units=1",
|
||||
"-C debuginfo=2",
|
||||
"-C opt-level=3",
|
||||
"-C relocation-model=pic",
|
||||
@@ -55,7 +54,7 @@ var (
|
||||
// This flag requires to have no space so that when it's exported to bazel
|
||||
// it can be removed. See aosp/2768339
|
||||
"--color=always",
|
||||
"-Zdylib-lto",
|
||||
"-Z dylib-lto",
|
||||
"-Z link-native-libraries=no",
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user