crill-dev / crill

The crill library
Boost Software License 1.0
188 stars 9 forks source link

Compiling on arm64 #18

Open manyids2 opened 2 weeks ago

manyids2 commented 2 weeks ago

Hi,

I am trying to compile tracktion engine using a buildroot cmake toolchain for arm64 target (gcc 13.3.0). I get the following errors:

/home/x/projects/launcher/modules/txn/modules/tracktion_engine/../3rd_party/crill/impl/progressive_backoff_wait_impl.h: In function ‘void crill::impl::progressive_backoff_wait_armv8(Predicate&&)’:
/home/x/projects/launcher/modules/txn/modules/tracktion_engine/../3rd_party/crill/impl/progressive_backoff_wait_impl.h:80:17: error: there are no arguments to ‘__wfe’ that depend on a template parameter, so a declaration of ‘__wfe’ must be available [-fpermissive]
   80 |                 __wfe();
      |                 ^~~~~

/home/x/projects/launcher/modules/txn/modules/tracktion_engine/../3rd_party/crill/impl/progressive_backoff_wait_impl.h:80:22: error: ‘__wfe’ was not declared in this scope
   80 |                 __wfe();
      |                 ~~~~~^~

How do I find out what I am missing? I have a file called arm_acle.h at gcc-final-13.3.0/gcc/config/aarch64/arm_acle.h , but it does not have any mention of wfe. Is there any alternative to using __wfe() from arm_acle.h? Can I copy its definition from another gcc version perhaps and test somehow that it works as intended?

manyids2 commented 2 weeks ago

I guess I can answer my own question at least till the compiling part, I added this definition after the #include <arm_acle.h>:

  #define __wfe()   __asm__ __volatile__ ("wfe" : : : "memory")

I ran into other building problems, so cannot check if it works yet unfortunately, but it did compile.