Hi all,
I’m having issues compiling the riot examples on MacOS on an M1 chip.
Initially I had an error in native_cpu.c
and irq_cpu.c
where the __eip
register wasn’t recognised. I replaced this with __pc
which solved that error.
static void _native_mod_ctx_leave_sigh(ucontext_t *ctx)
{
#ifdef __MACH__
_native_saved_eip = ((ucontext_t *)ctx)->uc_mcontext->__ss.__eip;
((ucontext_t *)ctx)->uc_mcontext->__ss.__eip = (unsigned int)&_native_sig_leave_handler;
#elif defined(__FreeBSD__) ...
However I then had a number of errors where the instruction mnemonics for some assembly instructions weren’t recognised:
/Users/ben/Desktop/Projects/RIOT/cpu/native/tramp.S:26:5: error: unrecognized instruction mnemonic, did you mean: fmov, mov, movi, movk, movn, movz, smov, umov?
movl $0x0, __native_in_isr
My guess is that RIOT is assuming that all macs are Intel-based. I tried to compile for ARM with the command line arguments -D__arm__=1 -U__MACH__
but there are a variety of errors such as no member named 'arm_pc' in 'struct __darwin_mcontext64'
which strongly suggest I’m not supposed to do that.
For now I will try to compile on Ubuntu in a VM or something, but compiling on my actual device would be far preferable. Let me know if I can provide any more useful information:)