Refactor sanitized library on-disk layout - Soong.

This CL moves the location of ASAN-ified libraries on disk in the
following manner:
/data/lib* --> /data/asan/system/lib*
/data/vendor/* --> /data/asan/vendor/*

There are a couple of advantages to this, including better isolation
from other components, and more transparent linker renaming and
SELinux policies.

(cherry picked from commit 1dd8839286)

Bug: 36574794
Bug: 36674745
Test: m -j40 && SANITIZE_TARGET="address" m -j40 and the device
boots. All sanitized libraries are correctly located in /data/asan/*.

Change-Id: I06bf459260ec451d4495a02562f640ad622f34c2
This commit is contained in:
Vishwath Mohan
2017-03-29 22:00:18 -07:00
committed by Andreas Gampe
parent 3943fd9b4c
commit 0d0a6f35da
6 changed files with 37 additions and 11 deletions

View File

@@ -89,6 +89,7 @@ type ModuleContext interface {
Proprietary() bool
InstallInData() bool
InstallInSanitizerDir() bool
RequiredModuleNames() []string
}
@@ -103,6 +104,7 @@ type Module interface {
Enabled() bool
Target() Target
InstallInData() bool
InstallInSanitizerDir() bool
SkipInstall()
}
@@ -399,6 +401,10 @@ func (p *ModuleBase) InstallInData() bool {
return false
}
func (p *ModuleBase) InstallInSanitizerDir() bool {
return false
}
func (a *ModuleBase) generateModuleTarget(ctx blueprint.ModuleContext) {
allInstalledFiles := Paths{}
allCheckbuildFiles := Paths{}
@@ -627,6 +633,10 @@ func (a *androidModuleContext) InstallInData() bool {
return a.module.InstallInData()
}
func (a *androidModuleContext) InstallInSanitizerDir() bool {
return a.module.InstallInSanitizerDir()
}
func (a *androidModuleContext) InstallFileName(installPath OutputPath, name string, srcPath Path,
deps ...Path) OutputPath {

View File

@@ -652,7 +652,10 @@ func PathForModuleInstall(ctx ModuleContext, paths ...string) OutputPath {
if ctx.Proprietary() {
partition = ctx.DeviceConfig().VendorPath()
}
if ctx.InstallInData() {
if ctx.InstallInSanitizerDir() {
partition = "data/asan/" + partition
} else if ctx.InstallInData() {
partition = "data"
}
outPaths = []string{"target", "product", ctx.AConfig().DeviceName(), partition}