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

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 16 15:09:42 PDT 2015


On 16 September 2015 at 22:52, Erik de Castro Lopo via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> 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.

Yes, GCC defaults to Thumb2. Yet another Triple issue that things are
not what they seem.

Here, the "arm" in "arm-linux-gnueabihf" means ARM the architecture,
not the instruction set. In LLVM, we mean as the instruction set, with
"thumb-linux-gnueabihf" as Thumb2.

You're not the first one to fall for that. As a matter of fact, that
was probably one of my first "bugs" in LLVM, too. :)


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

I'm glad you worked things out. :)

cheers,
--renato


More information about the llvm-dev mailing list