0028-Do-not-force-thumb-mode-directive.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From f69f7529bc8b561ddc32a5057da6d74d90dd9c94 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Sat, 12 Jun 2021 08:42:36 -0700
  4. Subject: [PATCH] Do not force thumb mode directive
  5. .thumb_func was not switching mode until [1]
  6. so it did not show up but now that .thumb_func (without argument) is
  7. switching mode, its causing build failures on armv6 ( rpi0 ) even when
  8. build is explicitly asking for this file to be built with -marm (ARM
  9. mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function
  10. header which considers arch and mode from compiler cmdline to decide if
  11. the function is built using thumb mode or arm mode.
  12. [1] https://reviews.llvm.org/D101975
  13. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  14. ---
  15. compiler-rt/lib/builtins/arm/sync-ops.h | 6 ++----
  16. 1 file changed, 2 insertions(+), 4 deletions(-)
  17. diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h
  18. index 7a26170741ad..d914f9d3a109 100644
  19. --- a/compiler-rt/lib/builtins/arm/sync-ops.h
  20. +++ b/compiler-rt/lib/builtins/arm/sync-ops.h
  21. @@ -16,9 +16,8 @@
  22. #define SYNC_OP_4(op) \
  23. .p2align 2; \
  24. - .thumb; \
  25. .syntax unified; \
  26. - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \
  27. + DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \
  28. DMB; \
  29. mov r12, r0; \
  30. LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \
  31. @@ -31,9 +30,8 @@
  32. #define SYNC_OP_8(op) \
  33. .p2align 2; \
  34. - .thumb; \
  35. .syntax unified; \
  36. - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \
  37. + DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \
  38. push {r4, r5, r6, lr}; \
  39. DMB; \
  40. mov r12, r0; \