ART: Restrict dex cache location check

Restrict the location check to the boot classpath. For app images,
the dex caches will contain the relative location, only.

For now, this is acceptable, as the location is only a debug feature.
Eventually, we may consider resetting the string.

(cherry picked from commit d5d807bc2d4e538f6f9a4cf5bb2b010482504c9d)

Bug: 130666977
Test: m test-art-host
Merged-In: I14e3968dffef31a7c95d3e06c55c85744487844c
Change-Id: I14e3968dffef31a7c95d3e06c55c85744487844c
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 35f1e84..f78d8d6 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2037,7 +2037,10 @@
   for (int32_t i = 0; i < dex_caches->GetLength(); i++) {
     ObjPtr<mirror::DexCache> dex_cache = dex_caches->Get(i);
     std::string dex_file_location = dex_cache->GetLocation()->ToModifiedUtf8();
-    DCHECK_EQ(dex_location, DexFileLoader::GetBaseLocation(dex_file_location));
+    if (class_loader == nullptr) {
+      // For app images, we'll see the relative location. b/130666977.
+      DCHECK_EQ(dex_location, DexFileLoader::GetBaseLocation(dex_file_location));
+    }
     std::unique_ptr<const DexFile> dex_file = OpenOatDexFile(oat_file,
                                                              dex_file_location.c_str(),
                                                              error_msg);