Support cc_prebuilt_binary building with Bazel
Bp2build-enable cc_prebuilt_binary -> cc_prebuilt_binary
Bug: 241415823
Test: cc_prebuilt_binary_conversion_test.go
Change-Id: I007deef8d44f68993012f2114314d1cb52cfbb0e
diff --git a/cc/library.go b/cc/library.go
index 13a7a3e..8e262eb 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -288,6 +288,16 @@
None bazel.BoolAttribute
}
+func stripAttrsFromLinkerAttrs(la *linkerAttributes) stripAttributes {
+ return stripAttributes{
+ Keep_symbols: la.stripKeepSymbols,
+ Keep_symbols_and_debug_frame: la.stripKeepSymbolsAndDebugFrame,
+ Keep_symbols_list: la.stripKeepSymbolsList,
+ All: la.stripAll,
+ None: la.stripNone,
+ }
+}
+
func libraryBp2Build(ctx android.TopDownMutatorContext, m *Module) {
// For some cc_library modules, their static variants are ready to be
// converted, but not their shared variants. For these modules, delegate to
@@ -394,13 +404,7 @@
Additional_linker_inputs: linkerAttrs.additionalLinkerInputs,
- Strip: stripAttributes{
- Keep_symbols: linkerAttrs.stripKeepSymbols,
- Keep_symbols_and_debug_frame: linkerAttrs.stripKeepSymbolsAndDebugFrame,
- Keep_symbols_list: linkerAttrs.stripKeepSymbolsList,
- All: linkerAttrs.stripAll,
- None: linkerAttrs.stripNone,
- },
+ Strip: stripAttrsFromLinkerAttrs(&linkerAttrs),
Features: baseAttributes.features,
}
@@ -2697,13 +2701,7 @@
Absolute_includes: compilerAttrs.absoluteIncludes,
Additional_linker_inputs: linkerAttrs.additionalLinkerInputs,
- Strip: stripAttributes{
- Keep_symbols: linkerAttrs.stripKeepSymbols,
- Keep_symbols_and_debug_frame: linkerAttrs.stripKeepSymbolsAndDebugFrame,
- Keep_symbols_list: linkerAttrs.stripKeepSymbolsList,
- All: linkerAttrs.stripAll,
- None: linkerAttrs.stripNone,
- },
+ Strip: stripAttrsFromLinkerAttrs(&linkerAttrs),
Features: baseAttributes.features,