summaryrefslogtreecommitdiff
path: root/rust/rust.go
diff options
context:
space:
mode:
author Vinh Tran <vinhdaitran@google.com> 2023-03-09 22:07:19 -0500
committer Vinh Tran <vinhdaitran@google.com> 2023-03-31 17:55:16 -0400
commitcde1016aff7cc5b9e89f68fd35c59393f4c1f8e4 (patch)
tree5e0d9c1aa5f756c5ee9eb7693ef54e29a8f764c0 /rust/rust.go
parent44cb78c988462e593ac66129dc85f80a98705bb2 (diff)
Reimplement afdo support for rust
Ignore-AOSP-First: The parent CL is internal Bug: 267229065 Test: go test Change-Id: Ia14679285b92f3f14ff269392a61f978c71311b2 Merged-In: Ia14679285b92f3f14ff269392a61f978c71311b2
Diffstat (limited to 'rust/rust.go')
-rw-r--r--rust/rust.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/rust/rust.go b/rust/rust.go
index f85babca4..ea7f9c67a 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -39,7 +39,6 @@ func init() {
ctx.BottomUp("rust_libraries", LibraryMutator).Parallel()
ctx.BottomUp("rust_stdlinkage", LibstdMutator).Parallel()
ctx.BottomUp("rust_begin", BeginMutator).Parallel()
-
})
android.PostDepsMutators(func(ctx android.RegisterMutatorsContext) {
ctx.BottomUp("rust_sanitizers", rustSanitizerRuntimeMutator).Parallel()
@@ -920,7 +919,7 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
// Calculate rustc flags
if mod.afdo != nil {
- flags, deps = mod.afdo.flags(ctx, flags, deps)
+ flags, deps = mod.afdo.flags(actx, flags, deps)
}
if mod.compiler != nil {
flags = mod.compiler.compilerFlags(ctx, flags)
@@ -1613,6 +1612,8 @@ func (mod *Module) DepsMutator(actx android.BottomUpMutatorContext) {
// proc_macros are compiler plugins, and so we need the host arch variant as a dependendcy.
actx.AddFarVariationDependencies(ctx.Config().BuildOSTarget.Variations(), procMacroDepTag, deps.ProcMacros...)
+
+ mod.afdo.addDep(ctx, actx)
}
// addRlibDependency will add an rlib dependency, rewriting to the snapshot library if available.