Fixed the issue that phony module was broken.

Phony module was broken since it reached the code line to try to
invoke some specific arch functions which caused the runtime panic
error.

Bug: 36739664
Test: mm -j32 -k
phony {
     name: "shell_and_utilities",
     required: [
         "grep",
         "gzip",
         "mkshrc",
         "reboot",
         "sh",
         "toolbox",
         "toybox",
     ],
}
in system/core/shell_and_utilities/Android.bp

Change-Id: Idf7da17d431aae5f0c56b08f5e5eef14ae4eef50
This commit is contained in:
Nan Zhang
2017-03-29 16:24:19 -07:00
parent 8d4e936630
commit 280802c102

View File

@@ -175,19 +175,21 @@ func translateAndroidMkModule(ctx blueprint.SingletonContext, w io.Writer, mod b
if data.Custom != nil {
prefix := ""
switch amod.Os().Class {
case Host:
prefix = "HOST_"
case HostCross:
prefix = "HOST_CROSS_"
case Device:
prefix = "TARGET_"
if amod.ArchSpecific() {
switch amod.Os().Class {
case Host:
prefix = "HOST_"
case HostCross:
prefix = "HOST_CROSS_"
case Device:
prefix = "TARGET_"
}
}
config := ctx.Config().(Config)
if amod.Arch().ArchType != config.Targets[amod.Os().Class][0].Arch.ArchType {
prefix = "2ND_" + prefix
config := ctx.Config().(Config)
if amod.Arch().ArchType != config.Targets[amod.Os().Class][0].Arch.ArchType {
prefix = "2ND_" + prefix
}
}
return data.Custom(w, name, prefix, filepath.Dir(ctx.BlueprintFile(mod)))