For compiling onboard or on another AArch64 SBC, I would suggest:
CFLAGS="-march=armv8-a+crypto+crc -mtune=cortex-a53"
I would suggest to stick to -O2 maximum optimization level during development.
Explanation:
"-mtune=cortex-a53" optimizes emitted code for the A53 cores.
"-march=armv8-a+crypto+crc" tells the assembler that the code generated can include instructions belonging to the ARMV8-A instruction set, plus CRC and Crypto extensions.
Note that for compiling the Linux kernel itself, I would suggest not to add any CFLAGS, although the -march and -mtune flags above should be safe. -O2 is set in the Linux kernel Makefile.
Reference: https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html#AArch64-Options
Comments
For cross compiling or for compiling on the board?
For compiling onboard. My Research results so far:
CFLAGS="-mcpu=cortex-a53+crc+crypto -mabi=lp64 -ftree-vectorize"
But - I'm missing a valid mfpu flag. Found this one for mcpu:
https://stackoverflow.com/questions/42718572/gcc-mtune-vs-march-vs-mcpu
You can just use "-march native -O3" if you only plan to run the executable locally.
For compiling onboard or on another AArch64 SBC, I would suggest:
CFLAGS="-march=armv8-a+crypto+crc -mtune=cortex-a53"
I would suggest to stick to -O2 maximum optimization level during development.
Explanation:
"-mtune=cortex-a53" optimizes emitted code for the A53 cores.
"-march=armv8-a+crypto+crc" tells the assembler that the code generated can include instructions belonging to the ARMV8-A instruction set, plus CRC and Crypto extensions.
Note that for compiling the Linux kernel itself, I would suggest not to add any CFLAGS, although the -march and -mtune flags above should be safe. -O2 is set in the Linux kernel Makefile.
Reference: https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html#AArch64-Options