OSDN Git Service

fix build failure on arm building C code in thumb1 mode
authorRich Felker <dalias@aerifal.cx>
Mon, 15 Jul 2019 19:33:12 +0000 (15:33 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 15 Jul 2019 19:33:12 +0000 (15:33 -0400)
a fully thumb1 build is not supported because some asm files are
incompatible with thumb1, but apparently it works to compile the C
code as thumb1

commit 06fbefd10046a0fae7e588b7c6d25fb51811b931 caused this regression
but introducing use of the clz instruction, which is not supported in
arm mode prior to v5, and not supported in thumb prior to thumb2
(v6t2). commit 1b9406b03c0a94ebe2076a8fc1746a8c45e78a83 fixed the
issue only for arm mode pre-v5 but left thumb1 broken.

arch/arm/atomic_arch.h

index e427836..9e3937c 100644 (file)
@@ -83,7 +83,7 @@ static inline void a_crash()
                : : : "memory");
 }
 
                : : : "memory");
 }
 
-#if __ARM_ARCH >= 5
+#if __ARM_ARCH >= 5 && (!__thumb__ || __thumb2__)
 
 #define a_clz_32 a_clz_32
 static inline int a_clz_32(uint32_t x)
 
 #define a_clz_32 a_clz_32
 static inline int a_clz_32(uint32_t x)