Support filegroups for version_script and related properties
Bug: 71715793 Test: m checkbuild Change-Id: Ibf78a5ec88e743f29504c91057d2cfced667c8b4
This commit is contained in:
@@ -110,6 +110,7 @@ type ModuleContext interface {
|
|||||||
|
|
||||||
ExpandSources(srcFiles, excludes []string) Paths
|
ExpandSources(srcFiles, excludes []string) Paths
|
||||||
ExpandSource(srcFile, prop string) Path
|
ExpandSource(srcFile, prop string) Path
|
||||||
|
ExpandOptionalSource(srcFile *string, prop string) OptionalPath
|
||||||
ExpandSourcesSubDir(srcFiles, excludes []string, subDir string) Paths
|
ExpandSourcesSubDir(srcFiles, excludes []string, subDir string) Paths
|
||||||
Glob(globPattern string, excludes []string) Paths
|
Glob(globPattern string, excludes []string) Paths
|
||||||
|
|
||||||
@@ -1162,6 +1163,16 @@ func (ctx *androidModuleContext) ExpandSource(srcFile, prop string) Path {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns an optional single path expanded from globs and modules referenced using ":module" syntax if
|
||||||
|
// the srcFile is non-nil.
|
||||||
|
// ExtractSourceDeps must have already been called during the dependency resolution phase.
|
||||||
|
func (ctx *androidModuleContext) ExpandOptionalSource(srcFile *string, prop string) OptionalPath {
|
||||||
|
if srcFile != nil {
|
||||||
|
return OptionalPathForPath(ctx.ExpandSource(*srcFile, prop))
|
||||||
|
}
|
||||||
|
return OptionalPath{}
|
||||||
|
}
|
||||||
|
|
||||||
func (ctx *androidModuleContext) ExpandSourcesSubDir(srcFiles, excludes []string, subDir string) Paths {
|
func (ctx *androidModuleContext) ExpandSourcesSubDir(srcFiles, excludes []string, subDir string) Paths {
|
||||||
prefix := PathForModuleSrc(ctx).String()
|
prefix := PathForModuleSrc(ctx).String()
|
||||||
|
|
||||||
|
@@ -158,6 +158,9 @@ func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
|
|||||||
ctx.ModuleErrorf("statically linking libc to dynamic executable, please remove libc\n" +
|
ctx.ModuleErrorf("statically linking libc to dynamic executable, please remove libc\n" +
|
||||||
"from static libs or set static_executable: true")
|
"from static libs or set static_executable: true")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
android.ExtractSourceDeps(ctx, binary.Properties.Version_script)
|
||||||
|
|
||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,7 +280,7 @@ func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags
|
|||||||
func (binary *binaryDecorator) link(ctx ModuleContext,
|
func (binary *binaryDecorator) link(ctx ModuleContext,
|
||||||
flags Flags, deps PathDeps, objs Objects) android.Path {
|
flags Flags, deps PathDeps, objs Objects) android.Path {
|
||||||
|
|
||||||
versionScript := android.OptionalPathForModuleSrc(ctx, binary.Properties.Version_script)
|
versionScript := ctx.ExpandOptionalSource(binary.Properties.Version_script, "version_script")
|
||||||
fileName := binary.getStem(ctx) + flags.Toolchain.ExecutableSuffix()
|
fileName := binary.getStem(ctx) + flags.Toolchain.ExecutableSuffix()
|
||||||
outputFile := android.PathForModuleOut(ctx, fileName)
|
outputFile := android.PathForModuleOut(ctx, fileName)
|
||||||
ret := outputFile
|
ret := outputFile
|
||||||
|
@@ -476,6 +476,13 @@ func (library *libraryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
|
|||||||
deps.SharedLibs = removeListFromList(deps.SharedLibs, library.baseLinker.Properties.Target.Vendor.Exclude_shared_libs)
|
deps.SharedLibs = removeListFromList(deps.SharedLibs, library.baseLinker.Properties.Target.Vendor.Exclude_shared_libs)
|
||||||
deps.StaticLibs = removeListFromList(deps.StaticLibs, library.baseLinker.Properties.Target.Vendor.Exclude_static_libs)
|
deps.StaticLibs = removeListFromList(deps.StaticLibs, library.baseLinker.Properties.Target.Vendor.Exclude_static_libs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
android.ExtractSourceDeps(ctx, library.Properties.Version_script)
|
||||||
|
android.ExtractSourceDeps(ctx, library.Properties.Unexported_symbols_list)
|
||||||
|
android.ExtractSourceDeps(ctx, library.Properties.Force_symbols_not_weak_list)
|
||||||
|
android.ExtractSourceDeps(ctx, library.Properties.Force_symbols_weak_list)
|
||||||
|
android.ExtractSourceDeps(ctx, library.Properties.Target.Vendor.Version_script)
|
||||||
|
|
||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -507,12 +514,12 @@ func (library *libraryDecorator) linkShared(ctx ModuleContext,
|
|||||||
var linkerDeps android.Paths
|
var linkerDeps android.Paths
|
||||||
linkerDeps = append(linkerDeps, flags.LdFlagsDeps...)
|
linkerDeps = append(linkerDeps, flags.LdFlagsDeps...)
|
||||||
|
|
||||||
versionScript := android.OptionalPathForModuleSrc(ctx, library.Properties.Version_script)
|
versionScript := ctx.ExpandOptionalSource(library.Properties.Version_script, "version_script")
|
||||||
unexportedSymbols := android.OptionalPathForModuleSrc(ctx, library.Properties.Unexported_symbols_list)
|
unexportedSymbols := ctx.ExpandOptionalSource(library.Properties.Unexported_symbols_list, "unexported_symbols_list")
|
||||||
forceNotWeakSymbols := android.OptionalPathForModuleSrc(ctx, library.Properties.Force_symbols_not_weak_list)
|
forceNotWeakSymbols := ctx.ExpandOptionalSource(library.Properties.Force_symbols_not_weak_list, "force_symbols_not_weak_list")
|
||||||
forceWeakSymbols := android.OptionalPathForModuleSrc(ctx, library.Properties.Force_symbols_weak_list)
|
forceWeakSymbols := ctx.ExpandOptionalSource(library.Properties.Force_symbols_weak_list, "force_symbols_weak_list")
|
||||||
if ctx.useVndk() && library.Properties.Target.Vendor.Version_script != nil {
|
if ctx.useVndk() && library.Properties.Target.Vendor.Version_script != nil {
|
||||||
versionScript = android.OptionalPathForModuleSrc(ctx, library.Properties.Target.Vendor.Version_script)
|
versionScript = ctx.ExpandOptionalSource(library.Properties.Target.Vendor.Version_script, "target.vendor.version_script")
|
||||||
}
|
}
|
||||||
if !ctx.Darwin() {
|
if !ctx.Darwin() {
|
||||||
if versionScript.Valid() {
|
if versionScript.Valid() {
|
||||||
|
Reference in New Issue
Block a user