Skip to content

Commit

Permalink
Correct auto-detected CPU type for Raspberry Pi
Browse files Browse the repository at this point in the history
The Raspberry Pi CPU is misdetected by LLVM, which means that hardware floating point instructions are not disassembled properly. `codegen.cpp` already has a work-around for this problem, explicitly enabling hardware floating point instructions on ARM systems. This patch is the counterpart for disassembling code.
  • Loading branch information
eschnett committed Dec 13, 2015
1 parent c741432 commit 0f52021
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/disasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,12 @@ void jl_dump_asm_internal(uintptr_t Fptr, size_t Fsize, size_t slide,
Triple TheTriple(Triple::normalize(TripleName));

std::string MCPU = sys::getHostCPUName();
#ifdef _CPU_ARM_
// The Raspberry Pi CPU is misdetected by LLVM (at least of version
// 3.6); correct this.
if (MCPU == "arm1176jz-s")
MCPU = "arm1176jzf-s";
#endif
SubtargetFeatures Features;
Features.getDefaultSubtargetFeatures(TheTriple);

Expand Down

0 comments on commit 0f52021

Please sign in to comment.