Don't store dex2oat-cmdline in oat of BCP ext
...and system server
dex2oat-cmdline is only used for debugging purpose. We may technically
exclude only for CompOS if needed, but unless there is demand, also
exlucde in the regular odrefresh case for simplicity.
Bug: 192690283
Test: atest ComposHostTestCases
Test: odrefresh --force-compile; oatdump boot-framework.oat
# no longer seeing dex2oat-cmdline
Change-Id: Id144a5ad3bb37f548a11f429b62eb81917981035
diff --git a/artd/libdexopt.cc b/artd/libdexopt.cc
index c064c2e..b9d4f4e 100644
--- a/artd/libdexopt.cc
+++ b/artd/libdexopt.cc
@@ -183,6 +183,12 @@
cmdline.emplace_back("--image-format=lz4");
cmdline.emplace_back("--force-determinism");
cmdline.emplace_back("--resolve-startup-const-strings=true");
+
+ // Avoid storing dex2oat cmdline in oat header. We want to be sure that the compiled artifacts
+ // are identical regardless of where the compilation happened. But some of the cmdline flags tends
+ // to be unstable, e.g. those contains FD numbers. To avoid the problem, the whole cmdline is not
+ // added to the oat header.
+ cmdline.emplace_back("--avoid-storing-invocation");
}
void AddDex2OatDebugInfo(/*inout*/ std::vector<std::string>& cmdline) {