mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] fix build failure on arm because of missing clz instruction
@ 2018-08-24 19:30 Szabolcs Nagy
  2018-08-24 21:58 ` Andre McCurdy
  0 siblings, 1 reply; 11+ messages in thread
From: Szabolcs Nagy @ 2018-08-24 19:30 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 77 bytes --]

another arm patch, clz usage (in fma) was broken with -mthumb -march=armv5t.

[-- Attachment #2: 0001-fix-build-failure-on-arm-because-of-missing-clz-inst.patch --]
[-- Type: text/x-diff, Size: 900 bytes --]

From b6036dd2256edca0181aa25de2259bcd03b21c2e Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 24 Aug 2018 15:59:17 +0000
Subject: [PATCH] fix build failure on arm because of missing clz instruction

In thumb mode clz is only available since armv6t2, in arm mode it is
available since armv5.

The preprocessor conditionals are changed accordingly.
---
 arch/arm/atomic_arch.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/atomic_arch.h b/arch/arm/atomic_arch.h
index 62458b45..868e5758 100644
--- a/arch/arm/atomic_arch.h
+++ b/arch/arm/atomic_arch.h
@@ -82,7 +82,8 @@ static inline void a_crash()
 		: : : "memory");
 }
 
-#if __ARM_ARCH >= 5
+#if __ARM_ARCH_6T2__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7 \
+ || (__ARM_ARCH >= 5 && !__thumb__)
 
 #define a_clz_32 a_clz_32
 static inline int a_clz_32(uint32_t x)
-- 
2.18.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-07-01 21:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-24 19:30 [PATCH] fix build failure on arm because of missing clz instruction Szabolcs Nagy
2018-08-24 21:58 ` Andre McCurdy
2018-08-24 22:04   ` Andre McCurdy
2018-08-24 22:05   ` Szabolcs Nagy
2018-08-24 22:50     ` Andre McCurdy
2018-08-24 23:20   ` Rich Felker
2019-06-28 22:55     ` Andre McCurdy
2019-06-29  4:19       ` Rich Felker
2019-07-01 19:09         ` Andre McCurdy
2019-07-01 20:09           ` Rich Felker
2019-07-01 21:09             ` Andre McCurdy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).