From 018cbebd7149afb14a60e84e4fd9c53ff63cd676 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 24 Jan 2022 17:22:45 -0800 Subject: [PATCH] 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 --- rust/rust.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rust/rust.go b/rust/rust.go index ee573fa43..0a941bf2d 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -1224,6 +1224,13 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { 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 {