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

Commit 329a0319 authored by Pierre-Clément Tosi's avatar Pierre-Clément Tosi Committed by Gerrit Code Review
Browse files

Merge "Support prefix_symbols for prebuilt libraries"

parents f5b0c2a1 6f630ae6
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -51,6 +51,9 @@ type prebuiltLinkerProperties struct {
	// symbols, etc), default true.
	Check_elf_files *bool

	// if set, add an extra objcopy --prefix-symbols= step
	Prefix_symbols *string

	// Optionally provide an import library if this is a Windows PE DLL prebuilt.
	// This is needed only if this library is linked by other modules in build time.
	// Only makes sense for the Windows target.
@@ -130,6 +133,13 @@ func (p *prebuiltLibraryLinker) link(ctx ModuleContext,

		in := android.PathForModuleSrc(ctx, srcs[0])

		if String(p.prebuiltLinker.properties.Prefix_symbols) != "" {
			prefixed := android.PathForModuleOut(ctx, "prefixed", srcs[0])
			transformBinaryPrefixSymbols(ctx, String(p.prebuiltLinker.properties.Prefix_symbols),
				in, flagsToBuilderFlags(flags), prefixed)
			in = prefixed
		}

		if p.static() {
			depSet := android.NewDepSetBuilder(android.TOPOLOGICAL).Direct(in).Build()
			ctx.SetProvider(StaticLibraryInfoProvider, StaticLibraryInfo{