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