Add bp2build support for cc_prebuilt_object
Add bp2build support for cc_prebuilt_object to allow buiiding
musl crt objects that use prebuilt clang_rt.crtbegin and
clang_rt.crtend.
Bug: 259266326
Test: //extenral/musl:libc_musl builds
Change-Id: Ic2b0375bc6e7336d31c9e2cf51bdc2ea894185aa
diff --git a/cc/bp2build.go b/cc/bp2build.go
index 6caa854..6ed62fc 100644
--- a/cc/bp2build.go
+++ b/cc/bp2build.go
@@ -337,6 +337,19 @@
}
}
+func bp2BuildParsePrebuiltObjectProps(ctx android.BazelConversionPathContext, module *Module) prebuiltAttributes {
+ var srcLabelAttribute bazel.LabelAttribute
+ bp2BuildPropParseHelper(ctx, module, &prebuiltObjectProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
+ if props, ok := props.(*prebuiltObjectProperties); ok {
+ parseSrc(ctx, &srcLabelAttribute, axis, config, props.Srcs)
+ }
+ })
+
+ return prebuiltAttributes{
+ Src: srcLabelAttribute,
+ }
+}
+
type baseAttributes struct {
compilerAttributes
linkerAttributes