From d6fdca89132b03a2e78724f92f485c9ef12a4486 Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Tue, 7 Apr 2020 12:30:33 -0400 Subject: [PATCH] Fix incorrect Rust installation paths. Rust binaries were installing to the wrong paths. This fixes the install path by only including the archtype subdir when there's a multilib conflict for that archtype. Bug: 153423714 Test: Example rust module installs to expected path. Change-Id: I63ea1ce7dae0d97d65522e0917d916b44808f442 --- rust/compiler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust/compiler.go b/rust/compiler.go index 4593165f4..81b258c1e 100644 --- a/rust/compiler.go +++ b/rust/compiler.go @@ -222,7 +222,10 @@ func (compiler *baseCompiler) installDir(ctx ModuleContext) android.InstallPath if ctx.toolchain().Is64Bit() && compiler.dir64 != "" { dir = compiler.dir64 } - if !ctx.Host() || ctx.Target().NativeBridge == android.NativeBridgeEnabled { + if ctx.Target().NativeBridge == android.NativeBridgeEnabled { + dir = filepath.Join(dir, ctx.Target().NativeBridgeRelativePath) + } + if !ctx.Host() && ctx.Config().HasMultilibConflict(ctx.Arch().ArchType) { dir = filepath.Join(dir, ctx.Arch().ArchType.String()) } return android.PathForModuleInstall(ctx, dir, compiler.subDir,