From: Kai Kang Date: Thu, 13 Dec 2018 02:55:36 +0000 (+0800) Subject: Fix: compile fails for x32 arch X-Git-Tag: v2.12.0-rc1~296 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=a1e4ab8b82429320c5f962038c0f28b874f8ea6f Fix: compile fails for x32 arch 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 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/utils.c b/src/bin/lttng/utils.c index fa2d3c9da..81e93952a 100644 --- a/src/bin/lttng/utils.c +++ b/src/bin/lttng/utils.c @@ -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) { diff --git a/src/common/utils.c b/src/common/utils.c index 17a313ee1..3cdb6b760 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -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) {