ARM-software/CSAL

Building the library for Cortex-M

Closed this issue · 3 comments

I tried to build the library for a Cortex-M board with a ARMv7e-M architecture.

I set ARCH=arm and CROSS_COMPILE=Path/to/arm-none-eabi- (gcc).

The build failed with:

In file included from ../source/cs_init_manage.c:25:
../source/cs_access_cmnfns.h:42:10: fatal error: sys/mman.h: No such file or directory
   42 | #include <sys/mman.h>
      |          ^~~~~~~~~~~~
compilation terminated.

Thanks for the report, we'll investigate but did you set BAREMETAL=1? One of BAREMETAL, UNIX_USERSPACE and UNIX_KERNEL needs to be set, the default is UNIX_USERSPACE - I don't believe it's clever enough to detect that it's cross-compiling for M-profile.

algr commented

Testing with "make BAREMETAL=1 CROSS_COMPILE=arm-none-eabi- ARCH=arm" hit a few compiler warnings (mostly around uint32_t), these should now be fixed. I'll leave this open in case anything else shows up.

Thank you for your fast answer! This solves the Problem.