summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_options.cc
diff options
context:
space:
mode:
authorAlexey Alexandrov <aalexand@google.com>2016-09-19 09:33:49 -0700
committerAlexey Alexandrov <aalexand@google.com>2016-10-05 19:20:14 -0700
commitab40c1108330caee9a01317628a28dac4c5a8bf1 (patch)
tree0e03c80a8a74cc4bed3f8dba8f238ce6ba2f6f0a /compiler/driver/compiler_options.cc
parent2f61867045ffbd0c38a4ecec5f59632004f7efff (diff)
Generate SHA-1 build ID for host-generated *.oat files (1/2).
For host-generated *.oat files, generate a SHA-1 build ID based on the file content and write it to .note.gnu.build-id ELF section. This should allow various developer tools like profilers correlate the data captured for files like boot.oat on the device with the corresponding known version of the file during an offline analysis. Test: Verified that boot.oat contains the build ID section now (with this change and https://android-review.googlesource.com/#/c/275630 applied) Test: Added ElfWriterTest::CheckBuildIdPresent test. Test: make test-art-host Bug: 31292208 Change-Id: Ie5e89da2ef87e34c27c0237ab34ddc7d2dc0aa3b
Diffstat (limited to 'compiler/driver/compiler_options.cc')
-rw-r--r--compiler/driver/compiler_options.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc
index cbcc169f41..c222f90043 100644
--- a/compiler/driver/compiler_options.cc
+++ b/compiler/driver/compiler_options.cc
@@ -37,6 +37,7 @@ CompilerOptions::CompilerOptions()
debuggable_(false),
generate_debug_info_(kDefaultGenerateDebugInfo),
generate_mini_debug_info_(kDefaultGenerateMiniDebugInfo),
+ generate_build_id_(false),
implicit_null_checks_(true),
implicit_so_checks_(true),
implicit_suspend_checks_(false),
@@ -97,6 +98,7 @@ CompilerOptions::CompilerOptions(CompilerFilter::Filter compiler_filter,
debuggable_(debuggable),
generate_debug_info_(generate_debug_info),
generate_mini_debug_info_(kDefaultGenerateMiniDebugInfo),
+ generate_build_id_(false),
implicit_null_checks_(implicit_null_checks),
implicit_so_checks_(implicit_so_checks),
implicit_suspend_checks_(implicit_suspend_checks),
@@ -196,6 +198,10 @@ bool CompilerOptions::ParseCompilerOption(const StringPiece& option, UsageFn Usa
generate_mini_debug_info_ = true;
} else if (option == "--no-generate-mini-debug-info") {
generate_mini_debug_info_ = false;
+ } else if (option == "--generate-build-id") {
+ generate_build_id_ = true;
+ } else if (option == "--no-generate-build-id") {
+ generate_build_id_ = false;
} else if (option == "--debuggable") {
debuggable_ = true;
} else if (option.starts_with("--top-k-profile-threshold=")) {