Custom CFLAGS when cross-compiling OpenWrt

Dear all,

I would like to (cross-)compile Openwrt for RPI 4 using the following CFLAGS="-march=armv8-a+crc+simd -mtune=cortex-a72 -ftree-vectorize -O2 -pipe -fomit-frame-pointer"

What is the recommended approach to ensure that kernel, modules and apps are compiled using these CFLAGS?

Thank you,
alex

You need to compile from source. In make menuconfig you can go to Advanced Developer Options and then Target Options at the bottom to change the CFLAGS.

1 Like

Excellent, thank you so much!