[compiler-rt] r314284 - [Builtins] ARM: Fix msr assembly instruction use for Thumb2.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 02:25:08 PDT 2017


> Tim, please review the patch so that I can land them again. Without these CLs, there is a builtin linkage mess where function declare themselves as thumb but are assembled in arm encoding.

https://reviews.llvm.org/D38268: should probably apply to all thumb modes but isn't the direct cause of this failure.

https://reviews.llvm.org/D38271: harmless.

https://reviews.llvm.org/D38227: the idea has a certain appeal: decide ARM/Thumb according to -marm/-mthumb rather than a CMake option. I can't decide if it's a hack or a elegant though.

The implementation unfortunately looks a bit dodgy. DEFINE_COMPILERRT_FUNCTION is used by architectures other than ARM and the patch tries to use ".arm"; that's definitely wrong.

Other than that, ARMv7k isn't anything special that needs hacking around. It's a bog-standard Cortex-A7: if the functions can't assemble in Thumb mode with "-arch armv7k" then the chances are they never will.

These functions have just never been compiled in Thumb mode before and need fixing up. In this particular case because you can't have a conditional branch to another function in Thumb mode on MachO targets (ELF *may* be able to do better, there is a R_ARM_THM_JUMP19 relocation, but I suspect it's a QoI issue).

Cheers.

Tim.


More information about the llvm-commits mailing list