0001-arm-fix-build-on-Thumb-only-architectures.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 034a3552e9700c6d424bd706db106f5bce1f5a5e Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Fri, 11 Nov 2016 21:49:39 +0100
  4. Subject: [PATCH] arm: fix build on Thumb-only architectures
  5. Building tinymembench for ARM Cortex-M currently fails, because the
  6. arm-neon.S file contains ARM code that doesn't build on Thumb-only
  7. architectures. To account for this and fix the build for Cortex-M,
  8. this patch adjusts the compile time condition to also verify that the
  9. architecture supports the ARM instruction set, by testing the
  10. __ARM_ARCH_ISA_ARM compiler define.
  11. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  12. ---
  13. arm-neon.S | 2 +-
  14. asm-opt.c | 2 +-
  15. 2 files changed, 2 insertions(+), 2 deletions(-)
  16. diff --git a/arm-neon.S b/arm-neon.S
  17. index 4db78ce..19c30ad 100644
  18. --- a/arm-neon.S
  19. +++ b/arm-neon.S
  20. @@ -21,7 +21,7 @@
  21. * DEALINGS IN THE SOFTWARE.
  22. */
  23. -#ifdef __arm__
  24. +#if defined(__arm__) && defined(__ARM_ARCH_ISA_ARM)
  25. .text
  26. .fpu neon
  27. diff --git a/asm-opt.c b/asm-opt.c
  28. index 9da4596..eba1183 100644
  29. --- a/asm-opt.c
  30. +++ b/asm-opt.c
  31. @@ -202,7 +202,7 @@ bench_info *get_asm_framebuffer_benchmarks(void)
  32. return empty;
  33. }
  34. -#elif defined(__arm__)
  35. +#elif defined(__arm__) && defined(__ARM_ARCH_ISA_ARM)
  36. #include "arm-neon.h"
  37. --
  38. 2.7.4