Add support for class loader context in dex2oat

The context can be passed to dex2oat using '--class-loader-
context=<string spec>'. It accepts a string specifying the intended
runtime loading context for the compiled dex files.

e.g. --class-loader-context=PCL[lib1.dex:lib2.dex];DLC[lib3.dex].

It describes how the class loader chain should be build in order to
ensure classes are resolved during dex2aot as they would be resolved at
runtime. This spec will be encoded in the oat file. If at runtime the
dex file will be loaded in a different context, the oat file will be
rejected.

The chain is interpreted in the natural 'parent order', meaning that
class loader 'i+1' will be the parent of class loader 'i'. The
compilation sources will be added to the classpath of the last class
loader. This allows the compiled dex files to be loaded at runtime in a
class loader that contains other dex files as well (e.g. shared
libraries).

Note that the compiler will be tolerant if the source dex files
specified with --dex-file are found in the classpath. The source dex
files will be removed from the any class loader's classpath possibly
resulting in empty class loaders.

Test: m test-art-host
Bug: 38138251
Change-Id: I3446ac7b2949d367dbc6d15729d3b203791eaac0
diff --git a/compiler/oat_writer.h b/compiler/oat_writer.h
index 9217701..024a3e8 100644
--- a/compiler/oat_writer.h
+++ b/compiler/oat_writer.h
@@ -153,7 +153,7 @@
       const VdexFile& vdex_file,
       const char* location,
       CreateTypeLookupTable create_type_lookup_table = CreateTypeLookupTable::kDefault);
-  dchecked_vector<const char*> GetSourceLocations() const;
+  dchecked_vector<std::string> GetSourceLocations() const;
 
   // Write raw dex files to the vdex file, mmap the file and open the dex files from it.
   // Supporting data structures are written into the .rodata section of the oat file.