You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB

  1. From e0212fb3278ca54ac6d3beecf990297670f2612f Mon Sep 17 00:00:00 2001
  2. From: Kai Kang <kai.kang@windriver.com>
  3. Date: Thu, 13 Dec 2018 10:55:36 +0800
  4. Subject: [PATCH] Fix: compile fails for x32 arch
  5. It fails to compile for x32 arch:
  6. | .../src/common/utils.c: Assembler messages:
  7. | .../src/common/utils.c:1026: Error: register type mismatch for `bsr'
  8. | .../src/common/utils.c:1028: Error: operand type mismatch for `movq'
  9. Add macro check that not to define that fls_u64() for x32.
  10. Signed-off-by: Kai Kang <kai.kang@windriver.com>
  11. ---
  12. src/bin/lttng/utils.c | 2 +-
  13. src/common/utils.c | 2 +-
  14. 2 files changed, 2 insertions(+), 2 deletions(-)
  15. diff --git a/src/bin/lttng/utils.c b/src/bin/lttng/utils.c
  16. index 0e96ef0c3..5c79c8c7e 100644
  17. --- a/src/bin/lttng/utils.c
  18. +++ b/src/bin/lttng/utils.c
  19. @@ -158,7 +158,7 @@ unsigned int fls_u32(uint32_t x)
  20. #define HAS_FLS_U32
  21. #endif
  22. -#if defined(__x86_64)
  23. +#if defined(__x86_64) && !defined(__ILP32__)
  24. static inline
  25. unsigned int fls_u64(uint64_t x)
  26. {
  27. diff --git a/src/common/utils.c b/src/common/utils.c
  28. index 08139e5e2..3c3899819 100644
  29. --- a/src/common/utils.c
  30. +++ b/src/common/utils.c
  31. @@ -1223,7 +1223,7 @@ static inline unsigned int fls_u32(uint32_t x)
  32. #define HAS_FLS_U32
  33. #endif
  34. -#if defined(__x86_64)
  35. +#if defined(__x86_64) && !defined(__ILP32__)
  36. static inline
  37. unsigned int fls_u64(uint64_t x)
  38. {