12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- From d42554b552128fad6ffe80ee72b0f1b6dc2cbccd Mon Sep 17 00:00:00 2001
- From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
- Date: Tue, 9 Nov 2021 11:01:27 +0800
- Subject: [PATCH 32/34] compiler-rt: Do not force thumb mode directive
- .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
- Rebased to LLVM 14.0.0 by Jun Yuan Tan
- Signed-off-by: Khem Raj <raj.khem@gmail.com>
- Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
- ---
- compiler-rt/lib/builtins/arm/sync-ops.h | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
- diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h
- index 7a26170741ad..d914f9d3a109 100644
- --- a/compiler-rt/lib/builtins/arm/sync-ops.h
- +++ b/compiler-rt/lib/builtins/arm/sync-ops.h
- @@ -16,9 +16,8 @@
-
- #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]; \
- @@ -31,9 +30,8 @@
-
- #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; \
- --
- 2.33.1
|