ART: Don't let dex2oat compile image space
Dex2oat should not be allowed to attempt image-space compilation.
It will generate one explicitly, or depend on an existing one.
This also properly reports a kCreateRuntime error return in all
cases (instead of an abort).
Bug: 37318304
Test: m test-art-host-gtest-dex2oat_test
Change-Id: I8a27de88de77475847e56f28ccab5afd3095d9c7
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 4cba36a..ea82133 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -2406,6 +2406,8 @@
if (!IsBootImage()) {
raw_options.push_back(std::make_pair("-Xno-dex-file-fallback", nullptr));
}
+ // Never allow implicit image compilation.
+ raw_options.push_back(std::make_pair("-Xnoimage-dex2oat", nullptr));
// Disable libsigchain. We don't don't need it during compilation and it prevents us
// from getting a statically linked version of dex2oat (because of dlsym and RTLD_NEXT).
raw_options.push_back(std::make_pair("-Xno-sig-chain", nullptr));