Support genrules as CrtBegin and CrtEnd in rust
Musl will use a genrule output as a linker script in CrtBegin,
support genrules as Crt* dependencies.
This is equivalent to Ie384089d26459797d0b4b5fef84846507fc508ad
in cc.
Bug: 216192129
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ibc08fdcff7a6bca2a1ec05b781ce929080e211bd
diff --git a/rust/rust.go b/rust/rust.go
index ee573fa..0a941bf 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -1224,6 +1224,13 @@
lib.exportLinkDirs(linkPath)
lib.exportLinkObjects(linkObject.String())
}
+ } else {
+ switch {
+ case depTag == cc.CrtBeginDepTag:
+ depPaths.CrtBegin = append(depPaths.CrtBegin, android.OutputFileForModule(ctx, dep, ""))
+ case depTag == cc.CrtEndDepTag:
+ depPaths.CrtEnd = append(depPaths.CrtEnd, android.OutputFileForModule(ctx, dep, ""))
+ }
}
if srcDep, ok := dep.(android.SourceFileProducer); ok {