From d7a11bc4b207fbc1455f90873d99c95c4576667c Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 17 Oct 2014 10:32:58 +0100 Subject: [PATCH] Fix dex2oat cross-compilation. The instruction set features was not correctly set when it was not given in the command line. Change-Id: I649cc077e7bbc830d281ae59af43e59fd0541c1b --- dex2oat/dex2oat.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 223be4c8e..326fa729b 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 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. -- 2.11.0