[Debian-med-packaging] Bug#976481: libatomic-queue: FTBFS on arm64: hardware.hpp:25:6: error: #warning "No hardware_pause implementation available - falling back to local volatile noop." [-Werror=cpp]

Steve McIntyre steve at einval.com
Sat Dec 5 16:31:03 GMT 2020


On Sat, Dec 05, 2020 at 05:11:00PM +0100, Andreas Tille wrote:
>Control: tags -1 help
>
>Hi Debian Arm team,
>
>I'm sorry, I have no idea how to fix this. :-(
>
>Any help would be welcome

Looking at a few of these, the packaging for libxenium-dev tells
lies. It claims to be Architecture: all but it looks like it will only
ever work on x86 and sparc. The packaging there needs to be fixed
(file a bug?), and if your package has to build-dep on it then you're
limited to the same architectures as well. That's absolutely fine:
just don't claim to support arches you cannot work on.

/usr/include/xenium/utils.hpp:
==========
namespace xenium { namespace detail {
  inline void hardware_pause() {
    // TODO - add pause implementations for ARM + Power
#if defined(XENIUM_ARCH_X86)
    _mm_pause();
#elif defined(XENIUM_ARCH_SPARC)
    smt_pause();
#else
    #warning "No hardware_pause implementation available - falling back to local volatile noop."
    // this effectively prevents the compiler from optimizing away the whole backoff operation
    volatile int x = 0;
    (void)x;
#endif
  }
}}
#endif
==========

/usr/include/xenium/utils.hpp:
==========
#if defined(__sparc__)
  static inline std::uint64_t getticks(void) {
      std::uint64_t ret;
      __asm__("rd %%tick, %0" : "=r" (ret));
      return ret;
  }
#elif defined(__x86_64__)
  static inline std::uint64_t getticks(void) {
      std::uint32_t hi, lo;
      __asm__ ("rdtsc" : "=a"(lo), "=d"(hi));
      return (static_cast<std::uint64_t>(hi) << 32) | static_cast<std::uint64_t>(lo);
  }
#elif defined(_M_AMD64)
  static inline std::uint64_t getticks(void) {
    return __rdtsc();
  }
#else
  // TODO - add support for more compilers!
  #error "Unsupported compiler"
#endif
==========

-- 
Steve McIntyre, Cambridge, UK.                                steve at einval.com
"Managing a volunteer open source project is a lot like herding
 kittens, except the kittens randomly appear and disappear because they
 have day jobs." -- Matt Mackall



More information about the Debian-med-packaging mailing list