dalias added a comment. Looking further at this, it looks like your current implementations of the __aeabi_* functions are simply wrong - they clobber registers that the ABI does not allow them to clobber. https://reviews.llvm.org/D39700