I am in the process of moving my project from gcc to clang. I am using RTT. Everything builds fine except the
The header is marked with
Build command:
Error message (repeated every time the macro is called):
Display All
My compiler
Display All
Thanks for help.
SEGGER_RTT_LOCK();
macro from SEGGER_RTT_Conf.h
(the code will build cleanly when I change that macro to empty).The header is marked with
Revision: $Rev: 13430 $
.Build command:
clang -o build_output/build/my_project_standalone.elf//my/project/path/libs/RTT/SEGGER_RTT.o -c -MD --target=arm-none-eabi -nostdlib --sysroot=/opt/toolchains/gcc-arm-none-eabi-9-2019-q4-major/bin/../arm-none-eabi -fshort-enums -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -I ../libs/CMSIS -I ../libs/RTT -I ../libs/ -Oz -std=gnu11 -Wall -pipe -ffunction-sections -fdata-sections -I/my/project/path/libs/libs/RTT /my/project/path/libs/RTT/SEGGER_RTT.c
Error message (repeated every time the macro is called):
C Source Code
- /my/project/path/libs/RTT/SEGGER_RTT.c:722:3: error: invalid instruction, any one of the following would fix this:
- SEGGER_RTT_LOCK();
- ^
- ../libs/RTT/SEGGER_RTT_Conf.h:133:73: note: expanded from macro 'SEGGER_RTT_LOCK'
- __asm volatile ("mrs %0, primask \n\t" \
- ^
- <inline asm>:2:2: note: instantiated into assembly here
- movs r1, $1
- ^
- /my/project/path/libs/RTT/SEGGER_RTT.c:722:3: note: operand must be an immediate in the range [0,255]
- SEGGER_RTT_LOCK();
- ^
- ../libs/RTT/SEGGER_RTT_Conf.h:133:73: note: expanded from macro 'SEGGER_RTT_LOCK'
- __asm volatile ("mrs %0, primask \n\t" \
- ^
- <inline asm>:2:12: note: instantiated into assembly here
- movs r1, $1
- ^
- /my/project/path/libs/RTT/SEGGER_RTT.c:722:3: note: operand must be a register in range [r0, r7]
- SEGGER_RTT_LOCK();
- ^
- ../libs/RTT/SEGGER_RTT_Conf.h:133:73: note: expanded from macro 'SEGGER_RTT_LOCK'
- __asm volatile ("mrs %0, primask \n\t" \
- ^
- <inline asm>:2:12: note: instantiated into assembly here
- movs r1, $1
- ^
My compiler
Shell-Script
- $ clang --version
- clang version 13.0.0
- Target: x86_64-pc-linux-gnu
- Thread model: posix
- InstalledDir: /usr/lib/llvm/13/bin
- $ llc --version
- LLVM (http://llvm.org/):
- LLVM version 13.0.0
- Optimized build.
- Default target: x86_64-pc-linux-gnu
- Host CPU: haswell
- Registered Targets:
- amdgcn - AMD GCN GPUs
- arm - ARM
- armeb - ARM (big endian)
- bpf - BPF (host endian)
- bpfeb - BPF (big endian)
- bpfel - BPF (little endian)
- nvptx - NVIDIA PTX 32-bit
- nvptx64 - NVIDIA PTX 64-bit
- r600 - AMD GPUs HD2XXX-HD6XXX
- thumb - Thumb
- thumbeb - Thumb (big endian)
- x86 - 32-bit X86: Pentium-Pro and above
- x86-64 - 64-bit X86: EM64T and AMD64
Thanks for help.