summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2014-10-17 10:32:58 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2014-10-17 10:32:58 +0100
commitd7a11bc4b207fbc1455f90873d99c95c4576667c (patch)
treeaf03e1277a3c20919e2f9aa0606a0cfa5ff3e4fb
parent8dcb9afc60972fddf1c6ee06cf7b272269d12766 (diff)
Fix dex2oat cross-compilation.
The instruction set features was not correctly set when it was not given in the command line. Change-Id: I649cc077e7bbc830d281ae59af43e59fd0541c1b
-rw-r--r--dex2oat/dex2oat.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 223be4c8e6..326fa729b2 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -837,7 +837,7 @@ static int dex2oat(int argc, char** argv) {
InstructionSet instruction_set = kRuntimeISA;
std::string error_msg;
std::unique_ptr<const InstructionSetFeatures> instruction_set_features(
- InstructionSetFeatures::FromFeatureString(instruction_set, "default", &error_msg));
+ InstructionSetFeatures::FromFeatureString(kNone, "default", &error_msg));
CHECK(instruction_set_features.get() != nullptr) << error_msg;
// Profile file to use
@@ -1152,6 +1152,13 @@ static int dex2oat(int argc, char** argv) {
oat_unstripped += oat_filename;
}
+ // If no instruction set feature was given, use the default one for the target
+ // instruction set.
+ if (instruction_set_features->GetInstructionSet() == kNone) {
+ instruction_set_features.reset(
+ InstructionSetFeatures::FromFeatureString(instruction_set, "default", &error_msg));
+ }
+
if (compiler_filter_string == nullptr) {
if (instruction_set == kMips64) {
// TODO: fix compiler for Mips64.