Allow failure in RecordClassStatus for uses-library classes

The problem was that recursive initialization attempts to initialize
classes in used libraries for the app image case. This meant we
attempted to add an oat class status for the uses-library classes.

Adding a regression test is infeasible since run-test doesn't support
uses-library.

Test: test-art-host
Bug: 63994775
Change-Id: If229d5deb3a0e5662839b0120c4c6d52bdcdcc57
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index dd58bc7..ea32c0c 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -2905,7 +2905,17 @@
   do {
     DexFileReference dex_ref(ref.first, ref.second);
     mirror::Class::Status existing = mirror::Class::kStatusNotReady;
-    CHECK(compiled_classes_.Get(dex_ref, &existing)) << dex_ref.dex_file->GetLocation();
+    if (!compiled_classes_.Get(dex_ref, &existing)) {
+      // Probably a uses library class, bail.
+      if (kIsDebugBuild) {
+        // Check to make sure it's not a dex file for an oat file we are compiling since these
+        // should always succeed. These do not include classes in for used libraries.
+        for (const DexFile* dex_file : *dex_files_for_oat_file_) {
+          CHECK_NE(dex_ref.dex_file, dex_file) << dex_ref.dex_file->GetLocation();
+        }
+      }
+      return;
+    }
     if (existing >= status) {
       // Existing status is already better than we expect, break.
       break;