.thumb_func was not switching mode until [1]
so it did not show up but now that .thumb_func (without argument) is
switching mode, its causing build failures on armv6 ( rpi0 ) even when
build is explicitly asking for this file to be built with -marm (ARM
mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function
header which considers arch and mode from compiler cmdline to decide if
the function is built using thumb mode or arm mode.
[1] https://reviews.llvm.org/D101975
Note that it also needs https://reviews.llvm.org/D99282
Reviewed By: peter.smith, MaskRay
Differential Revision: https://reviews.llvm.org/D104183
#define SYNC_OP_4(op) \
.p2align 2; \
- .thumb; \
.syntax unified; \
- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \
+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \
DMB; \
mov r12, r0; \
LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \
#define SYNC_OP_8(op) \
.p2align 2; \
- .thumb; \
.syntax unified; \
- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \
+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \
push {r4, r5, r6, lr}; \
DMB; \
mov r12, r0; \