Fix using kArm instead of kThumb2.
Change-Id: I0f3bf93b38d910bc57d017693675829b6a39bc18
diff --git a/compiler/dex/frontend.cc b/compiler/dex/frontend.cc
index e48e5bf..201dc47 100644
--- a/compiler/dex/frontend.cc
+++ b/compiler/dex/frontend.cc
@@ -155,13 +155,16 @@
cu.compiler_driver = &driver;
cu.class_linker = class_linker;
cu.instruction_set = driver.GetInstructionSet();
+ if (cu.instruction_set == kArm) {
+ cu.instruction_set = kThumb2;
+ }
cu.target64 = (cu.instruction_set == kX86_64) || (cu.instruction_set == kArm64);
cu.compiler = compiler;
// TODO: x86_64 & arm64 are not yet implemented.
- DCHECK((cu.instruction_set == kThumb2) ||
- (cu.instruction_set == kX86) ||
- (cu.instruction_set == kX86_64) ||
- (cu.instruction_set == kMips));
+ CHECK((cu.instruction_set == kThumb2) ||
+ (cu.instruction_set == kX86) ||
+ (cu.instruction_set == kX86_64) ||
+ (cu.instruction_set == kMips));
/* Adjust this value accordingly once inlining is performed */
diff --git a/compiler/elf_writer_quick.cc b/compiler/elf_writer_quick.cc
index f6a324f..e88ed42 100644
--- a/compiler/elf_writer_quick.cc
+++ b/compiler/elf_writer_quick.cc
@@ -367,6 +367,8 @@
elf_header.e_ident[EI_ABIVERSION] = 0;
elf_header.e_type = ET_DYN;
switch (compiler_driver_->GetInstructionSet()) {
+ case kArm:
+ // Fall through.
case kThumb2: {
elf_header.e_machine = EM_ARM;
elf_header.e_flags = EF_ARM_EABI_VER5;
@@ -396,7 +398,6 @@
EF_MIPS_ARCH_32R2);
break;
}
- case kArm:
default: {
LOG(FATAL) << "Unknown instruction set: " << compiler_driver_->GetInstructionSet();
break;