Revert "Revert "Fix NDK library sysroot arrangement.""
This reverts commit 961cf1cf9c
.
Reason for revert: Fixed
Change-Id: I3c5c0b89c924753b62c1bc126d7e64975ef7f137
This commit is contained in:
@@ -26,7 +26,6 @@ import (
|
|||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
"android/soong/bazel"
|
"android/soong/bazel"
|
||||||
"android/soong/bazel/cquery"
|
"android/soong/bazel/cquery"
|
||||||
"android/soong/cc/config"
|
|
||||||
|
|
||||||
"github.com/google/blueprint"
|
"github.com/google/blueprint"
|
||||||
"github.com/google/blueprint/pathtools"
|
"github.com/google/blueprint/pathtools"
|
||||||
@@ -2261,8 +2260,7 @@ func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) {
|
|||||||
!ctx.useVndk() && !ctx.inRamdisk() && !ctx.inVendorRamdisk() && !ctx.inRecovery() && ctx.Device() &&
|
!ctx.useVndk() && !ctx.inRamdisk() && !ctx.inVendorRamdisk() && !ctx.inRecovery() && ctx.Device() &&
|
||||||
library.baseLinker.sanitize.isUnsanitizedVariant() &&
|
library.baseLinker.sanitize.isUnsanitizedVariant() &&
|
||||||
ctx.isForPlatform() && !ctx.isPreventInstall() {
|
ctx.isForPlatform() && !ctx.isPreventInstall() {
|
||||||
installPath := getNdkSysrootBase(ctx).Join(
|
installPath := getUnversionedLibraryInstallPath(ctx).Join(ctx, file.Base())
|
||||||
ctx, "usr/lib", config.NDKTriple(ctx.toolchain()), file.Base())
|
|
||||||
|
|
||||||
ctx.ModuleBuild(pctx, android.ModuleBuildParams{
|
ctx.ModuleBuild(pctx, android.ModuleBuildParams{
|
||||||
Rule: android.Cp,
|
Rule: android.Cp,
|
||||||
|
@@ -528,17 +528,20 @@ func (stub *stubDecorator) nativeCoverage() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (stub *stubDecorator) install(ctx ModuleContext, path android.Path) {
|
// Returns the install path for unversioned NDK libraries (currently only static
|
||||||
arch := ctx.Target().Arch.ArchType.Name
|
// libraries).
|
||||||
// arm64 isn't actually a multilib toolchain, so unlike the other LP64
|
func getUnversionedLibraryInstallPath(ctx ModuleContext) android.InstallPath {
|
||||||
// architectures it's just installed to lib.
|
return getNdkSysrootBase(ctx).Join(ctx, "usr/lib", config.NDKTriple(ctx.toolchain()))
|
||||||
libDir := "lib"
|
}
|
||||||
if ctx.toolchain().Is64Bit() && arch != "arm64" {
|
|
||||||
libDir = "lib64"
|
|
||||||
}
|
|
||||||
|
|
||||||
installDir := getNdkInstallBase(ctx).Join(ctx, fmt.Sprintf(
|
// Returns the install path for versioned NDK libraries. These are most often
|
||||||
"platforms/android-%s/arch-%s/usr/%s", stub.apiLevel, arch, libDir))
|
// stubs, but the same paths are used for CRT objects.
|
||||||
|
func getVersionedLibraryInstallPath(ctx ModuleContext, apiLevel android.ApiLevel) android.InstallPath {
|
||||||
|
return getUnversionedLibraryInstallPath(ctx).Join(ctx, apiLevel.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (stub *stubDecorator) install(ctx ModuleContext, path android.Path) {
|
||||||
|
installDir := getVersionedLibraryInstallPath(ctx, stub.apiLevel)
|
||||||
stub.installPath = ctx.InstallFile(installDir, path.Base(), path)
|
stub.installPath = ctx.InstallFile(installDir, path.Base(), path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user