Merge changes I1617a601,Ifa324bea

* changes:
  ART: Apply --no-inline-from= option on device.
  Postpone DexCache preloading in the ImageWriter.
diff --git a/build/codegen.go b/build/codegen.go
index 8526bf1..d0db78e 100644
--- a/build/codegen.go
+++ b/build/codegen.go
@@ -107,8 +107,9 @@
 }
 
 type CodegenCommonArchProperties struct {
-	Srcs   []string
-	Cflags []string
+	Srcs     []string
+	Cflags   []string
+	Cppflags []string
 }
 
 type CodegenLibraryArchProperties struct {
diff --git a/compiler/Android.bp b/compiler/Android.bp
index 30a65b2..0d92b05 100644
--- a/compiler/Android.bp
+++ b/compiler/Android.bp
@@ -183,7 +183,6 @@
     shared_libs: [
         "libbase",
         "libcutils",  // for atrace.
-        "liblzma",
     ],
     include_dirs: ["art/disassembler"],
     header_libs: [
@@ -199,7 +198,6 @@
     static_libs: [
         "libbase",
         "libcutils",
-        "liblzma",
     ],
 }
 
@@ -233,12 +231,12 @@
             // VIXL assembly support for ARM targets.
             static: {
                 whole_static_libs: [
-                    "libvixl-arm",
+                    "libvixl",
                 ],
             },
             shared: {
                 shared_libs: [
-                    "libvixl-arm",
+                    "libvixl",
                 ],
             },
         },
@@ -246,12 +244,12 @@
             // VIXL assembly support for ARM64 targets.
             static: {
                 whole_static_libs: [
-                    "libvixl-arm64",
+                    "libvixl",
                 ],
             },
             shared: {
                 shared_libs: [
-                    "libvixl-arm64",
+                    "libvixl",
                 ],
             },
         },
@@ -295,12 +293,12 @@
             // VIXL assembly support for ARM targets.
             static: {
                 whole_static_libs: [
-                    "libvixld-arm",
+                    "libvixld",
                 ],
             },
             shared: {
                 shared_libs: [
-                    "libvixld-arm",
+                    "libvixld",
                 ],
             },
         },
@@ -308,12 +306,12 @@
             // VIXL assembly support for ARM64 targets.
             static: {
                 whole_static_libs: [
-                    "libvixld-arm64",
+                    "libvixld",
                 ],
             },
             shared: {
                 shared_libs: [
-                    "libvixld-arm64",
+                    "libvixld",
                 ],
             },
         },
@@ -454,8 +452,7 @@
         "libprofiled",
         "libartd-compiler",
         "libartd-simulator-container",
-        "libvixld-arm",
-        "libvixld-arm64",
+        "libvixld",
 
         "libbacktrace",
         "libnativeloader",
@@ -512,7 +509,6 @@
     },
     shared_libs: [
         "libartd-compiler",
-        "libvixld-arm",
-        "libvixld-arm64",
+        "libvixld",
     ],
 }
diff --git a/dex2oat/Android.bp b/dex2oat/Android.bp
index fd5f3cd..8ce96a4 100644
--- a/dex2oat/Android.bp
+++ b/dex2oat/Android.bp
@@ -71,11 +71,8 @@
     generated_sources: ["art_dex2oat_operator_srcs"],
     shared_libs: [
         "libbase",
-        "liblz4",
-        "liblzma",
     ],
     include_dirs: [
-        "external/lz4/lib",
         "external/zlib",
     ],
     export_include_dirs: ["."],
@@ -98,8 +95,6 @@
     },
     static_libs: [
         "libbase",
-        "liblz4",
-        "liblzma",
     ],
 }
 
@@ -247,7 +242,6 @@
         "libdexfile",
         "libartbase",
         "libbase",
-        "liblz4",
         "libsigchain",
     ],
     static_libs: [
@@ -285,7 +279,6 @@
         "libdexfiled",
         "libartbased",
         "libbase",
-        "liblz4",
         "libsigchain",
     ],
     static_libs: [
@@ -315,7 +308,6 @@
     ],
     static_libs: [
         "libbase",
-        "liblz4",
         "libsigchain_dummy",
     ],
 }
@@ -411,11 +403,11 @@
         "external/zlib",
     ],
     shared_libs: [
-        "libprofiled",
+        "libartbased",
         "libartd-compiler",
         "libartd-dexlayout",
         "libbase",
-        "liblz4",
+        "libprofiled",
         "libsigchain",
         "libziparchive",
     ],
diff --git a/disassembler/Android.bp b/disassembler/Android.bp
index a7c1802..5aa159e 100644
--- a/disassembler/Android.bp
+++ b/disassembler/Android.bp
@@ -69,8 +69,7 @@
     defaults: ["libart-disassembler-defaults"],
     shared_libs: [
         // For disassembler_arm*.
-        "libvixl-arm",
-        "libvixl-arm64",
+        "libvixl",
     ],
 }
 
@@ -82,7 +81,6 @@
     ],
     shared_libs: [
         // For disassembler_arm*.
-        "libvixld-arm",
-        "libvixld-arm64",
+        "libvixld",
     ],
 }
diff --git a/libartbase/Android.bp b/libartbase/Android.bp
index 5010f68..6a667bc 100644
--- a/libartbase/Android.bp
+++ b/libartbase/Android.bp
@@ -54,6 +54,10 @@
                 "libziparchive",
                 "libz",
             ],
+            // Exclude the version script from Darwin host since it's not
+            // supported by the linker there. That means ASan checks on Darwin
+            // might trigger ODR violations.
+            version_script: "libartbase.map",
         },
         host: {
             shared_libs: [
@@ -61,16 +65,31 @@
                 "libz",
             ],
         },
+        linux_glibc: {
+            version_script: "libartbase.map",
+        },
+        windows: {
+            version_script: "libartbase.map",
+        },
     },
     generated_sources: ["art_libartbase_operator_srcs"],
     cflags: ["-DBUILDING_LIBART=1"],
     shared_libs: [
         "liblog",
-	// For ashmem.
+        // For ashmem.
         "libcutils",
         // For common macros.
         "libbase",
     ],
+
+    // Utilities used by various ART libs and tools are linked in statically
+    // here to avoid shared lib dependencies outside the ART APEX. No target
+    // there should depend on these separately.
+    whole_static_libs: [
+        "liblz4",
+        "liblzma",
+    ],
+
     export_include_dirs: ["."],
     // ART's macros.h depends on libbase's macros.h.
     // Note: runtime_options.h depends on cmdline. But we don't really want to export this
diff --git a/libartbase/libartbase.map b/libartbase/libartbase.map
new file mode 100644
index 0000000..6249930
--- /dev/null
+++ b/libartbase/libartbase.map
@@ -0,0 +1,15 @@
+# This is used only to hide data symbols that get imported through
+# whole_static_libs, or else they might trigger the ASan odr-violation check.
+# Before adding symbols here, please make sure that it doesn't give rise to a
+# real ODR problem. All these symbols are either in .rodata or .data.rel.ro
+# sections.
+LIBARTBASE {
+  local:
+    PPMD7_kExpEscape;
+    XZ_SIG;
+    g_AlignedAlloc;
+    g_Alloc;
+    g_BigAlloc;
+    g_MidAlloc;
+    k7zSignature;
+};
diff --git a/oatdump/Android.bp b/oatdump/Android.bp
index 596a946..45f853b 100644
--- a/oatdump/Android.bp
+++ b/oatdump/Android.bp
@@ -100,8 +100,7 @@
     ],
     static_libs: [
         "libart-disassembler",
-        "libvixl-arm",
-        "libvixl-arm64",
+        "libvixl",
     ],
 }
 
@@ -124,8 +123,7 @@
     },
     static_libs: [
         "libartd-disassembler",
-        "libvixld-arm",
-        "libvixld-arm64",
+        "libvixld",
     ],
     group_static_libs: true,
 }
diff --git a/runtime/Android.bp b/runtime/Android.bp
index 86ee952..410901e 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -377,7 +377,6 @@
     include_dirs: [
         "art/sigchainlib",
         "external/icu/icu4c/source/common",
-        "external/lz4/lib",
         "external/zlib",
     ],
     header_libs: [
@@ -390,7 +389,6 @@
         "libnativebridge",
         "libnativeloader",
         "libbacktrace",
-        "liblz4",
         "liblog",
         // For atrace, properties, ashmem, set_sched_policy.
         "libcutils",
@@ -422,8 +420,6 @@
         "libbase",
         "libcutils",
         "liblog",
-        "liblz4",
-        "liblzma",
         "libnativebridge",
         "libnativeloader",
         "libunwindstack",
@@ -661,8 +657,7 @@
     ],
     shared_libs: [
         "libartd-compiler",
-        "libvixld-arm",
-        "libvixld-arm64",
+        "libvixld",
     ],
 }
 
diff --git a/simulator/Android.bp b/simulator/Android.bp
index 8690426..223c891 100644
--- a/simulator/Android.bp
+++ b/simulator/Android.bp
@@ -45,7 +45,7 @@
     shared_libs: [
         "libart",
         "libartbase",
-        "libvixl-arm64",
+        "libvixl",
     ],
 }
 
@@ -58,7 +58,7 @@
     shared_libs: [
         "libartd",
         "libartbased",
-        "libvixld-arm64",
+        "libvixld",
     ],
 }
 
diff --git a/test/Android.bp b/test/Android.bp
index 561f95e..d85e2a6 100644
--- a/test/Android.bp
+++ b/test/Android.bp
@@ -59,8 +59,7 @@
     shared_libs: [
         "libartd",
         "libartd-disassembler",
-        "libvixld-arm",
-        "libvixld-arm64",
+        "libvixld",
         "libart-gtest",
         "libdexfiled",
         "libprofiled",
diff --git a/test/testrunner/run_build_test_target.py b/test/testrunner/run_build_test_target.py
index 14287b0..b4a4ada 100755
--- a/test/testrunner/run_build_test_target.py
+++ b/test/testrunner/run_build_test_target.py
@@ -62,6 +62,18 @@
 print(custom_env)
 os.environ.update(custom_env)
 
+# build is just a binary/script that is directly executed to build any artifacts needed for the
+# test.
+if 'build' in target:
+  build_command = target.get('build').format(
+      ANDROID_BUILD_TOP = env.ANDROID_BUILD_TOP,
+      MAKE_OPTIONS='DX=  -j{threads}'.format(threads = n_threads))
+  sys.stdout.write(str(build_command) + '\n')
+  sys.stdout.flush()
+  if subprocess.call(build_command.split()):
+    sys.exit(1)
+
+# make runs soong/kati to build the target listed in the entry.
 if 'make' in target:
   build_command = 'build/soong/soong_ui.bash --make-mode'
   build_command += ' DX='
@@ -107,7 +119,8 @@
     run_test_command += ['--host']
     run_test_command += ['--dex2oat-jobs']
     run_test_command += ['4']
-  run_test_command += ['-b']
+  if '--no-build-dependencies' not in test_flags:
+    run_test_command += ['-b']
   run_test_command += ['--verbose']
 
   sys.stdout.write(str(run_test_command) + '\n')
diff --git a/test/testrunner/target_config.py b/test/testrunner/target_config.py
index 9efe435..077129f 100644
--- a/test/testrunner/target_config.py
+++ b/test/testrunner/target_config.py
@@ -329,4 +329,11 @@
     'art-golem-linux-x64': {
         'golem' : 'linux-x64'
     },
+    'art-linux-bionic-x64': {
+        'build': '{ANDROID_BUILD_TOP}/art/tools/build_linux_bionic_tests.sh {MAKE_OPTIONS}',
+        'run-test': ['--run-test-option=--bionic',
+                     '--host',
+                     '--64',
+                     '--no-build-dependencies'],
+    },
 }