[llvm-dev] Arm: disabling/disallowing Thumb instructions

Erik de Castro Lopo via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 16 14:52:20 PDT 2015


Tim Northover wrote:

> That shouldn't be happening. The "armv6" ought to imply ARM mode. What
> Thumb instructions are you seeing, and do you have a .ll file that
> reproduces the issue with standard tools or is it just the way GHC is
> driving LLVM?

Sorry false alarm.

I was a looking an object file produced by GCC compiling a C file, not
an object file produced by GHC compiling a Haskell file.

GHC on Linux uses GCC by default to compile C (GHC's runtime system is
written in C) and LLC/OPT when compiling Haskell code. For some reason
gcc on armhf/linux by default produces Thumb code. GCC needs to be passed
-marm on the command line to force production of pure Arm code.

This has finally got me to the bottom on one of the most difficult bugs
I've ever worked on.

Cheers,
Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the llvm-dev mailing list