aboutsummaryrefslogtreecommitdiffstats
path: root/cc/library.go
diff options
context:
space:
mode:
authorJustin Yun <justinyun@google.com>2017-06-23 19:24:43 +0900
committerJustin Yun <justinyun@google.com>2017-07-18 14:48:29 +0900
commit8effde47def8609b08be27f75d9f24f8b943e3ed (patch)
tree223d67bd1a21ad363ba8eec952cbb1b24cc85b83 /cc/library.go
parentda4a7257b5b4c4fd41b8e8e084713e3e4f20187b (diff)
downloadbuild_soong-8effde47def8609b08be27f75d9f24f8b943e3ed.tar.gz
build_soong-8effde47def8609b08be27f75d9f24f8b943e3ed.tar.bz2
build_soong-8effde47def8609b08be27f75d9f24f8b943e3ed.zip
Install VNDK libs in /system instead of /vendor
If BOARD_VNDK_VERSION is set, and a module is set to `vendor_available: true` it is installed in /system and /vendor. However, if the module is a VNDK library, it must be installed at `/system/${LIB}/vndk` instead of /vendor/${LIB}. For those modules, need following to set. vendor_available: true, vndk: { enabled: true, support_system_process: true, }, `support_system_process` is optional to define. If it is defined to true, the module is regarded as vndk-sp. link-type check for VNDK modules is added to make sure that VNDK modules only link to other VNDK shared libraries or LL-NDKs. move the ABI checks to VNDK from all of vendor_available. Bug: 38304436 Test: attempt to compile with BOARD_VNDK_VERSION:=current Test: Use `vendor_available_vndk: true` for VNDK modules and compile with BOARD_VNDK_VERSION:=current Change-Id: I409268e0b7f05a9d01697bf9f9f4726b5aac631f
Diffstat (limited to 'cc/library.go')
-rw-r--r--cc/library.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/cc/library.go b/cc/library.go
index c7c11426..3d463bdb 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -156,7 +156,7 @@ type flagExporter struct {
}
func (f *flagExporter) exportedIncludes(ctx ModuleContext) android.Paths {
- if ctx.Vendor() && f.Properties.Target.Vendor.Export_include_dirs != nil {
+ if ctx.vndk() && f.Properties.Target.Vendor.Export_include_dirs != nil {
return android.PathsForModuleSrc(ctx, f.Properties.Target.Vendor.Export_include_dirs)
} else {
return android.PathsForModuleSrc(ctx, f.Properties.Export_include_dirs)
@@ -351,7 +351,7 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa
}
return Objects{}
}
- if (ctx.createVndkSourceAbiDump() || (library.sabi.Properties.CreateSAbiDumps && ctx.Device())) && !ctx.Vendor() {
+ if ctx.createVndkSourceAbiDump() {
exportIncludeDirs := android.PathsForModuleSrc(ctx, library.flagExporter.Properties.Export_include_dirs)
var SourceAbiFlags []string
for _, dir := range exportIncludeDirs.Strings() {
@@ -596,7 +596,7 @@ func (library *libraryDecorator) linkShared(ctx ModuleContext,
func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objects, fileName string, soFile android.Path) {
//Also take into account object re-use.
- if len(objs.sAbiDumpFiles) > 0 && ctx.createVndkSourceAbiDump() && !ctx.Vendor() {
+ if len(objs.sAbiDumpFiles) > 0 && ctx.createVndkSourceAbiDump() {
refSourceDumpFile := android.PathForVndkRefAbiDump(ctx, "current", fileName, vndkVsNdk(ctx), true)
versionScript := android.OptionalPathForModuleSrc(ctx, library.Properties.Version_script)
var symbolFile android.OptionalPath
@@ -699,6 +699,15 @@ func (library *libraryDecorator) toc() android.OptionalPath {
func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) {
if library.shared() {
+ if ctx.Device() {
+ if ctx.vndk() {
+ if ctx.isVndkSp() {
+ library.baseInstaller.subDir = "vndk-sp"
+ } else if ctx.isVndk() {
+ library.baseInstaller.subDir = "vndk"
+ }
+ }
+ }
library.baseInstaller.install(ctx, file)
}
}