ARM-software / LLVM-embedded-toolchain-for-Arm

A project dedicated to building LLVM toolchain for 32-bit Arm embedded targets.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when compiling micro-ecc

zxtxin opened this issue · comments

I build micro-ecc with the following parameters:
-std=c11 --config armv6m_soft_nofp_nosys.cfg -mno-unaligned-access -fshort-enums -fshort-wchar -g -ffunction-sections -fdata-sections -faapcs-bitfield-width -fno-common -Wall -Os

It comes out that
image

Hello. Does adding -fomit-frame-pointer help? GCC will have that enabled by default (when not at -O0) where as clang will not, and that will lose you a register.

I think the frame pointer is definitely it. Looking at the register trace in clang it r7 is reserved, and this block of inline asm needs every low register. I've checked that -fomit-frame-pointer will work, and gcc will not work with -fno-omit-frame-pointer

In the source file there is a .syntax divided line. Clang doesn't support that and at least my version gave an error message.

Yes, it compiles with clang -target arm-eabi -march=armv6-m -std=c11 -mno-unaligned-access -fshort-enums -fshort-wchar -ffunction-sections -fdata-sections -faapcs-bitfield-width -fno-common -Wall -Os -c -fomit-frame-pointer

(after removing the .syntax divided)

The issue seems to be resolved, closing.