aboutsummaryrefslogtreecommitdiff
path: root/dexpreopt
diff options
context:
space:
mode:
authorUlya Trafimovich <skvadrik@google.com>2021-07-14 16:07:41 +0100
committerUlya Trafimovich <skvadrik@google.com>2021-07-15 11:17:24 +0100
commitfa20b187dc2471b9cd0705e4c95e7bed1fcd503c (patch)
treef40fe9f3ab7afec13201b93d2d43c5f81dcbf8dd /dexpreopt
parent8410eb1551742844c967e3a563c606566d8a9c37 (diff)
downloadsoong-fa20b187dc2471b9cd0705e4c95e7bed1fcd503c.tar.gz
Drop "prebuilt_" prefix when adding libraries to class loader context.
This is needed when some source libraries get replaced with prebuilt variants: CLC should contain one entry for a library (the prebuilt one or the source one, whichever of them is preferred). Because the prebuilt module name starts with "prebuilt_" prefix, previously Soong considered such libraries as two different ones libraries and added both to CLC. Bug: 193425964 Test: mark "prebuilt_android.net.ipsec.ike" as preferred and `m nothing` (before this CL it would fail the build, now it builds fine). Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd $ adb wait-for-device && \ adb root && \ adb logcat | \ grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C 1 # empty output, no errors Change-Id: Icc42533d9915060d7fffda12aa93b9d18dc4f83d Merged-In: Icc42533d9915060d7fffda12aa93b9d18dc4f83d (cherry picked from commit 69c1aa94ac88bcb07f32c2ae4217776e82903068)
Diffstat (limited to 'dexpreopt')
-rw-r--r--dexpreopt/class_loader_context.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/dexpreopt/class_loader_context.go b/dexpreopt/class_loader_context.go
index f76a205aa..57b4c4f3f 100644
--- a/dexpreopt/class_loader_context.go
+++ b/dexpreopt/class_loader_context.go
@@ -257,6 +257,9 @@ const AnySdkVersion int = android.FutureApiLevelInt
func (clcMap ClassLoaderContextMap) addContext(ctx android.ModuleInstallPathContext, sdkVer int, lib string,
hostPath, installPath android.Path, nestedClcMap ClassLoaderContextMap) error {
+ // For prebuilts, library should have the same name as the source module.
+ lib = android.RemoveOptionalPrebuiltPrefix(lib)
+
devicePath := UnknownInstallLibraryPath
if installPath == nil {
if android.InList(lib, CompatUsesLibs) || android.InList(lib, OptionalCompatUsesLibs) {