summaryrefslogtreecommitdiffstats
path: root/dex2oat
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-09-17 21:49:47 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-17 21:49:47 +0000
commit1b5a5dc82b9618d9deef62962954bfb9871a88d1 (patch)
treef9a882292875d867040ba91b91125bebdc393e61 /dex2oat
parent347409fdbdf8b9d3638beb7dbdb8c51b843bd899 (diff)
parent33cb94e5e5b50330fb9fbafe90d1a2a6bd026e2f (diff)
downloadart-1b5a5dc82b9618d9deef62962954bfb9871a88d1.zip
art-1b5a5dc82b9618d9deef62962954bfb9871a88d1.tar.gz
art-1b5a5dc82b9618d9deef62962954bfb9871a88d1.tar.bz2
Merge "ART: Sync oat file to disk before patching"
Diffstat (limited to 'dex2oat')
-rw-r--r--dex2oat/dex2oat.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index b64390b..afc01dc 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -442,6 +442,11 @@ class Dex2Oat {
return nullptr;
}
+ // Flush result to disk. Patching code will re-open the file (mmap), so ensure that our view
+ // of the file already made it there and won't be re-ordered with writes from PatchOat or
+ // image patching.
+ oat_file->Flush();
+
if (!driver->IsImage() && driver->GetCompilerOptions().GetIncludePatchInformation()) {
t2.NewTiming("Patching ELF");
std::string error_msg;