blob: 88559ec0120c23c4e1c049d9c952adb6cff8f2d9 [file] [log] [blame]
Thomas Petazzoni064004a2016-11-11 22:09:04 +01001From 034a3552e9700c6d424bd706db106f5bce1f5a5e Mon Sep 17 00:00:00 2001
2From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3Date: Fri, 11 Nov 2016 21:49:39 +0100
4Subject: [PATCH] arm: fix build on Thumb-only architectures
5
6Building tinymembench for ARM Cortex-M currently fails, because the
7arm-neon.S file contains ARM code that doesn't build on Thumb-only
8architectures. To account for this and fix the build for Cortex-M,
9this patch adjusts the compile time condition to also verify that the
10architecture supports the ARM instruction set, by testing the
11__ARM_ARCH_ISA_ARM compiler define.
12
13Signed-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
19diff --git a/arm-neon.S b/arm-neon.S
20index 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
32diff --git a/asm-opt.c b/asm-opt.c
33index 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--
462.7.4
47