Only copy native binaries on native-bridge configs

If native-bridge/ndk translation is supported for a config the build
system will know about 2 copies of binaries, one for each ABI. We only
want to actually install the 'Native' (non-translated) ABI into the
apex in these situations.

Test: lunch aosp_cf_x86_phone-userdebug
      m showcommands com.android.runtime.debug
      examine the command output to make sure only a single copy of
      dex2oat is being installed.

Change-Id: I9480e52855fd9f5564a579099309fb38f1c50367
This commit is contained in:
Alex Light
2019-01-24 11:37:55 -08:00
parent 2ad817c65d
commit 16df4e868e

View File

@@ -570,6 +570,11 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
case executableTag:
if cc, ok := child.(*cc.Module); ok {
if !cc.Arch().Native {
// There is only one 'bin' directory so we shouldn't bother copying in
// native-bridge'd binaries and only use main ones.
return true
}
fileToCopy, dirInApex := getCopyManifestForExecutable(cc)
filesInfo = append(filesInfo, apexFile{fileToCopy, depName, cc.Arch().ArchType, dirInApex, nativeExecutable, cc})
return true