Fix: compile fails for x32 arch
authorKai Kang <kai.kang@windriver.com>
Thu, 13 Dec 2018 02:55:36 +0000 (10:55 +0800)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 22 Oct 2019 19:01:29 +0000 (15:01 -0400)
LTTng-Tools fails to compile for the x32 ABI:

| .../src/common/utils.c: Assembler messages:
| .../src/common/utils.c:1026: Error: register type mismatch for `bsr'
| .../src/common/utils.c:1028: Error: operand type mismatch for `movq'

Add a macro to only use the x86_64 inline assembly version of fls_u64()
when the LP64 ABI is used.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/utils.c
src/common/utils.c

index fa2d3c9da626542fc9a0d1bb78bdf017197eedd1..81e93952ad139ad9466a9723099a7884d0911c5c 100644 (file)
@@ -159,7 +159,7 @@ unsigned int fls_u32(uint32_t x)
 #define HAS_FLS_U32
 #endif
 
-#if defined(__x86_64)
+#if defined(__x86_64) && defined(__LP64__)
 static inline
 unsigned int fls_u64(uint64_t x)
 {
index 17a313ee16f66efe8c574ddfddc8f94f156b9e11..3cdb6b76063caf4545761a93b52523dd2c39b14c 100644 (file)
@@ -1014,7 +1014,7 @@ static inline unsigned int fls_u32(uint32_t x)
 #define HAS_FLS_U32
 #endif
 
-#if defined(__x86_64)
+#if defined(__x86_64) && defined(__LP64__)
 static inline
 unsigned int fls_u64(uint64_t x)
 {
This page took 0.038131 seconds and 4 git commands to generate.