convert hidden visibility flag to feature
in bp2build. The context here is that `-fvisibility=default` should only be added for CFI if `-fvisibility=hidden` is not already specified. This will be achieved using toolchain features. Note that Soong itself never adds `-fvisibility=hidden`. This is only ever added in the `cflags` property of a bp file. Bug: 261733820 Test: Unit tests Change-Id: Ib821e8c30a9cd03d2929b4bd2e771bec7b33fa66
This commit is contained in:
@@ -311,6 +311,11 @@ func libraryBp2Build(ctx android.TopDownMutatorContext, m *Module) {
|
||||
asFlags = bazel.MakeStringListAttribute(nil)
|
||||
}
|
||||
|
||||
sharedFeatures := baseAttributes.features.Clone().Append(sharedAttrs.Features)
|
||||
sharedFeatures.DeduplicateAxesFromBase()
|
||||
staticFeatures := baseAttributes.features.Clone().Append(staticAttrs.Features)
|
||||
staticFeatures.DeduplicateAxesFromBase()
|
||||
|
||||
staticCommonAttrs := staticOrSharedAttributes{
|
||||
Srcs: *srcs.Clone().Append(staticAttrs.Srcs),
|
||||
Srcs_c: *compilerAttrs.cSrcs.Clone().Append(staticAttrs.Srcs_c),
|
||||
@@ -366,7 +371,7 @@ func libraryBp2Build(ctx android.TopDownMutatorContext, m *Module) {
|
||||
Cpp_std: compilerAttrs.cppStd,
|
||||
C_std: compilerAttrs.cStd,
|
||||
|
||||
Features: baseAttributes.features,
|
||||
Features: *staticFeatures,
|
||||
}
|
||||
|
||||
sharedTargetAttrs := &bazelCcLibrarySharedAttributes{
|
||||
@@ -390,7 +395,7 @@ func libraryBp2Build(ctx android.TopDownMutatorContext, m *Module) {
|
||||
Additional_linker_inputs: linkerAttrs.additionalLinkerInputs,
|
||||
|
||||
Strip: stripAttrsFromLinkerAttrs(&linkerAttrs),
|
||||
Features: baseAttributes.features,
|
||||
Features: *sharedFeatures,
|
||||
bazelCcHeaderAbiCheckerAttributes: bp2buildParseAbiCheckerProps(ctx, m),
|
||||
|
||||
Fdo_profile: compilerAttrs.fdoProfile,
|
||||
@@ -2881,6 +2886,9 @@ func sharedOrStaticLibraryBp2Build(ctx android.TopDownMutatorContext, module *Mo
|
||||
asFlags = bazel.MakeStringListAttribute(nil)
|
||||
}
|
||||
|
||||
features := baseAttributes.features.Clone().Append(libSharedOrStaticAttrs.Features)
|
||||
features.DeduplicateAxesFromBase()
|
||||
|
||||
commonAttrs := staticOrSharedAttributes{
|
||||
Srcs: compilerAttrs.srcs,
|
||||
Srcs_c: compilerAttrs.cSrcs,
|
||||
@@ -2922,7 +2930,7 @@ func sharedOrStaticLibraryBp2Build(ctx android.TopDownMutatorContext, module *Mo
|
||||
Conlyflags: compilerAttrs.conlyFlags,
|
||||
Asflags: asFlags,
|
||||
|
||||
Features: baseAttributes.features,
|
||||
Features: *features,
|
||||
}
|
||||
} else {
|
||||
commonAttrs.Dynamic_deps.Add(baseAttributes.protoDependency)
|
||||
@@ -2951,7 +2959,7 @@ func sharedOrStaticLibraryBp2Build(ctx android.TopDownMutatorContext, module *Mo
|
||||
|
||||
Strip: stripAttrsFromLinkerAttrs(&linkerAttrs),
|
||||
|
||||
Features: baseAttributes.features,
|
||||
Features: *features,
|
||||
|
||||
Suffix: compilerAttrs.suffix,
|
||||
|
||||
|
Reference in New Issue
Block a user