Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fd6a41a authored by Colin Cross's avatar Colin Cross
Browse files

Add suffix and target.vendor.suffix to shared libraries

And make prebuilt shared libraries suffix and stem too.

This will be used for the vendor version of the protobuf
runtime shared libraries to append the protobuf version
number to the installed file name, which will help with
updating protobuf in the future.

Bug: 117607748
Test: m checkbuild
Change-Id: I8919a4f2e1be1ced29198af758077baf56c1f7a7
Merged-In: I8919a4f2e1be1ced29198af758077baf56c1f7a7
parent 6ac04600
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -88,6 +88,16 @@ type LibraryProperties struct {
	// set the name of the output
	Stem *string `android:"arch_variant"`

	// set suffix of the name of the output
	Suffix *string `android:"arch_variant"`

	Target struct {
		Vendor struct {
			// set suffix of the name of the output
			Suffix *string `android:"arch_variant"`
		}
	}

	// Names of modules to be overridden. Listed modules can only be other shared libraries
	// (in Make or Soong).
	// This does not completely prevent installation of the overridden libraries, but if both
@@ -549,7 +559,7 @@ type libraryInterface interface {
	androidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Writer)
}

func (library *libraryDecorator) getLibName(ctx ModuleContext) string {
func (library *libraryDecorator) getLibName(ctx BaseModuleContext) string {
	name := library.libName
	if name == "" {
		name = String(library.Properties.Stem)
@@ -558,6 +568,16 @@ func (library *libraryDecorator) getLibName(ctx ModuleContext) string {
		}
	}

	suffix := ""
	if ctx.useVndk() {
		suffix = String(library.Properties.Target.Vendor.Suffix)
	}
	if suffix == "" {
		suffix = String(library.Properties.Suffix)
	}

	name += suffix

	if ctx.isVndkExt() {
		name = ctx.getVndkExtendsModuleName()
	}
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ func (p *prebuiltLibraryLinker) link(ctx ModuleContext,

		if p.shared() {
			p.unstrippedOutputFile = in
			libName := ctx.baseModuleName() + flags.Toolchain.ShlibSuffix()
			libName := p.libraryDecorator.getLibName(ctx) + flags.Toolchain.ShlibSuffix()
			if p.needsStrip(ctx) {
				stripped := android.PathForModuleOut(ctx, "stripped", libName)
				p.stripExecutableOrSharedLib(ctx, in, stripped, builderFlags)