rust: add ccToolchain to Module
The cc toolchain information is required when using cc.Stripper.
Move to a Module method to avoid importing the cc package everywhere.
Test: m nothing
Bug: 153430439
Change-Id: I497dcdff4e767ecb8b8688c73cf88850c302683d
diff --git a/rust/bindgen.go b/rust/bindgen.go
index 9b09e61..3f7a6ce 100644
--- a/rust/bindgen.go
+++ b/rust/bindgen.go
@@ -21,7 +21,6 @@
"github.com/google/blueprint/proptools"
"android/soong/android"
- ccConfig "android/soong/cc/config"
)
var (
@@ -92,8 +91,8 @@
Properties BindgenProperties
}
-func (b *bindgenDecorator) GenerateSource(ctx android.ModuleContext, deps PathDeps) android.Path {
- ccToolchain := ccConfig.FindToolchain(ctx.Os(), ctx.Arch())
+func (b *bindgenDecorator) GenerateSource(ctx ModuleContext, deps PathDeps) android.Path {
+ ccToolchain := ctx.RustModule().ccToolchain(ctx)
var cflags []string
var implicits android.Paths