Aarch64 Support

When trying to build I get error:

zrythm/ext/crill/progressive_backoff_wait.h:47:4: error: #error "Platform not supported!"
47 | #  error "Platform not supported!"

Linux 6.14.8-400.asahi.fc42.aarch64+16k

It seems like ‘crill’, a Zrythm dependency, is not recognising your platform (possibly due to AArch64 + 16K pages).

To get better help from us, please share:

  1. full compiler output before the error,
  2. output of gcc -dM -E - < /dev/null | grep -iE ‘arm|arch’, and
  3. confirm if you’re building natively on Asahi or cross-compiling.

Knowing where and how the build occurs would help in determining:

  • If the problem comes directly from the unusual architecture/kernel (Asahi AArch64 + 16K pages),

  • Or if it stems from complexities in the build setup itself (cross-compile issues).

Hope that makes sense. :slight_smile:

-S

Relevant code:

// crill - the Cross-platform Real-time, I/O, and Low-Latency Library
// Copyright (c) 2022 - Timur Doumler and Fabian Renn-Giles
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)

#ifndef CRILL_PLATFORM_H
#define CRILL_PLATFORM_H

#if defined (__arm__)
  #define CRILL_ARM 1
  #define CRILL_32BIT 1
  #define CRILL_ARM_32BIT 1
#elif defined (__arm64__)
  #define CRILL_ARM 1
  #define CRILL_64BIT 1
  #define CRILL_ARM_64BIT 1
#elif defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86)
  #define CRILL_INTEL 1
  #define CRILL_32BIT 1
  #define CRILL_INTEL_32BIT 1
#elif defined(__x86_64__) || defined(_M_X64)
  #define CRILL_INTEL 1
  #define CRILL_64BIT 1
  #define CRILL_INTEL_64BIT 1
#endif

#endif //CRILL_PLATFORM_H
// crill - the Cross-platform Real-time, I/O, and Low-Latency Library
// Copyright (c) 2022 - Timur Doumler and Fabian Renn-Giles
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)

#ifndef CRILL_PROGRESSIVE_BACKOFF_WAIT_H
#define CRILL_PROGRESSIVE_BACKOFF_WAIT_H

#include <crill/impl/progressive_backoff_wait_impl.h>
#include <crill/platform.h>

namespace crill
{

// Effects: Blocks the current thread until predicate returns true. Blocking is
// implemented by spinning on the predicate with a progressive backoff strategy.
//
// crill::progressive_backoff_wait is used to implement crill::spin_mutex, but
// is also useful on its own, in scenarios where a thread needs to wait on
// something else than a spinlock being released (for example, a CAS loop).
//
// Compared to a naive implementation like
//
//    while (!predicate()) /* spin */;
//
// the progressive backoff strategy prevents wasting energy, and allows other
// threads to progress by yielding from the waiting thread after a certain
// amount of time. This time is currently chosen to be approximately 1 ms on a
// typical 64-bit Intel or ARM based machine.
//
// On platforms other than x86, x86_64, and arm64, no implementation is
// currently available.
template <typename Predicate>
void
progressive_backoff_wait (Predicate &&pred)
{
#if defined(CRILL_INTEL) && CRILL_INTEL
  impl::progressive_backoff_wait_intel<5, 10, 3000> (
    std::forward<Predicate> (pred));
  // approx. 5x5 ns (= 25 ns), 10x40 ns (= 400 ns), and 3000x350 ns (~ 1 ms),
  // respectively, when measured on a 2.9 GHz Intel i9
#elif defined(CRILL_ARM_64BIT) && CRILL_ARM_64BIT
  impl::progressive_backoff_wait_armv8<2, 750> (std::forward<Predicate> (pred));
  // approx. 2x10 ns (= 20 ns) and 750x1333 ns (~ 1 ms), respectively, on an
  // Apple Silicon Mac or an armv8 based phone.
#else
#  error "Platform not supported!"
#endif
}

} // namespace crill

#endif // CRILL_PROGRESSIVE_BACKOFF_WAIT_H

So I guess __arm64__ is not defined by your compiler. This code compiles when building for Mac M1.