Export the default LOCAL_STRIP_MODULE value am: f2c27d7370
am: dfc181440f
Change-Id: I61ba62d29e8047b1984fdc2eac54cd9eb74ba206
This commit is contained in:
@@ -23,6 +23,10 @@ import (
|
|||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type AndroidMkContext interface {
|
||||||
|
Target() android.Target
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) {
|
func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) {
|
||||||
if c.Properties.HideFromMake {
|
if c.Properties.HideFromMake {
|
||||||
ret.Disabled = true
|
ret.Disabled = true
|
||||||
@@ -48,9 +52,9 @@ func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) {
|
|||||||
callSubAndroidMk := func(obj interface{}) {
|
callSubAndroidMk := func(obj interface{}) {
|
||||||
if obj != nil {
|
if obj != nil {
|
||||||
if androidmk, ok := obj.(interface {
|
if androidmk, ok := obj.(interface {
|
||||||
AndroidMk(*android.AndroidMkData)
|
AndroidMk(AndroidMkContext, *android.AndroidMkData)
|
||||||
}); ok {
|
}); ok {
|
||||||
androidmk.AndroidMk(&ret)
|
androidmk.AndroidMk(c, &ret)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,7 +72,7 @@ func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) {
|
|||||||
return ret, nil
|
return ret, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (library *baseLinker) AndroidMk(ret *android.AndroidMkData) {
|
func (library *baseLinker) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||||
if library.static() {
|
if library.static() {
|
||||||
ret.Class = "STATIC_LIBRARIES"
|
ret.Class = "STATIC_LIBRARIES"
|
||||||
} else {
|
} else {
|
||||||
@@ -76,11 +80,11 @@ func (library *baseLinker) AndroidMk(ret *android.AndroidMkData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (library *libraryLinker) AndroidMk(ret *android.AndroidMkData) {
|
func (library *libraryLinker) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||||
library.baseLinker.AndroidMk(ret)
|
library.baseLinker.AndroidMk(ctx, ret)
|
||||||
|
|
||||||
if !library.static() {
|
if !library.static() {
|
||||||
library.stripper.AndroidMk(ret)
|
library.stripper.AndroidMk(ctx, ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
||||||
@@ -102,7 +106,7 @@ func (library *libraryLinker) AndroidMk(ret *android.AndroidMkData) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (object *objectLinker) AndroidMk(ret *android.AndroidMkData) {
|
func (object *objectLinker) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||||
ret.Custom = func(w io.Writer, name, prefix string) error {
|
ret.Custom = func(w io.Writer, name, prefix string) error {
|
||||||
out := ret.OutputFile.Path()
|
out := ret.OutputFile.Path()
|
||||||
|
|
||||||
@@ -113,8 +117,8 @@ func (object *objectLinker) AndroidMk(ret *android.AndroidMkData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (binary *binaryLinker) AndroidMk(ret *android.AndroidMkData) {
|
func (binary *binaryLinker) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||||
binary.stripper.AndroidMk(ret)
|
binary.stripper.AndroidMk(ctx, ret)
|
||||||
|
|
||||||
ret.Class = "EXECUTABLES"
|
ret.Class = "EXECUTABLES"
|
||||||
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
||||||
@@ -124,15 +128,15 @@ func (binary *binaryLinker) AndroidMk(ret *android.AndroidMkData) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (test *testBinaryLinker) AndroidMk(ret *android.AndroidMkData) {
|
func (test *testBinaryLinker) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||||
test.binaryLinker.AndroidMk(ret)
|
test.binaryLinker.AndroidMk(ctx, ret)
|
||||||
if Bool(test.testLinker.Properties.Test_per_src) {
|
if Bool(test.testLinker.Properties.Test_per_src) {
|
||||||
ret.SubName = test.binaryLinker.Properties.Stem
|
ret.SubName = test.binaryLinker.Properties.Stem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (library *toolchainLibraryLinker) AndroidMk(ret *android.AndroidMkData) {
|
func (library *toolchainLibraryLinker) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||||
library.baseLinker.AndroidMk(ret)
|
library.baseLinker.AndroidMk(ctx, ret)
|
||||||
|
|
||||||
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
||||||
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := "+outputFile.Ext())
|
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := "+outputFile.Ext())
|
||||||
@@ -143,19 +147,26 @@ func (library *toolchainLibraryLinker) AndroidMk(ret *android.AndroidMkData) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (stripper *stripper) AndroidMk(ret *android.AndroidMkData) {
|
func (stripper *stripper) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||||
|
// Make only supports stripping target modules
|
||||||
|
if ctx.Target().Os != android.Android {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
||||||
if stripper.StripProperties.Strip.None {
|
if stripper.StripProperties.Strip.None {
|
||||||
fmt.Fprintln(w, "LOCAL_STRIP_MODULE := false")
|
fmt.Fprintln(w, "LOCAL_STRIP_MODULE := false")
|
||||||
} else if stripper.StripProperties.Strip.Keep_symbols {
|
} else if stripper.StripProperties.Strip.Keep_symbols {
|
||||||
fmt.Fprintln(w, "LOCAL_STRIP_MODULE := keep_symbols")
|
fmt.Fprintln(w, "LOCAL_STRIP_MODULE := keep_symbols")
|
||||||
|
} else {
|
||||||
|
fmt.Fprintln(w, "LOCAL_STRIP_MODULE := mini-debug-info")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (installer *baseInstaller) AndroidMk(ret *android.AndroidMkData) {
|
func (installer *baseInstaller) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||||
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
||||||
path := installer.path.RelPathString()
|
path := installer.path.RelPathString()
|
||||||
dir, file := filepath.Split(path)
|
dir, file := filepath.Split(path)
|
||||||
|
Reference in New Issue
Block a user