Don't use custom mixed build logic for cc_object
Starlark implementation of cc_object now performs partial linking, which
better matches Soong's implementation of cc_object.
Bug: 181794963
Test: generate build files with bp2build, mixed build droid
Change-Id: I5a325aa1c608981deaee3671ac28c6014e6cbf08
diff --git a/cc/object.go b/cc/object.go
index 6bea28b..05499b6 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -53,8 +53,17 @@
}
func (handler *objectBazelHandler) generateBazelBuildActions(ctx android.ModuleContext, label string) bool {
- // TODO(b/181794963): restore mixed builds once cc_object incompatibility resolved
- return false
+ bazelCtx := ctx.Config().BazelContext
+ objPaths, ok := bazelCtx.GetOutputFiles(label, ctx.Arch().ArchType)
+ if ok {
+ if len(objPaths) != 1 {
+ ctx.ModuleErrorf("expected exactly one object file for '%s', but got %s", label, objPaths)
+ return false
+ }
+
+ handler.module.outputFile = android.OptionalPathForPath(android.PathForBazelOut(ctx, objPaths[0]))
+ }
+ return ok
}
type ObjectLinkerProperties struct {