I see that, in menuconfig, when building for a tiny 4/32 WR-940 v6, kernel build option "Compiler optimization level" is missing. Frankly speaking, I didn't notice it until building for the new WR-841N v13 which is MediaTek-based and 8/64, where that option is available. So I need some guidelines.
I guess it's because, being a 4/32 device, optimizing for performance woludn't be smart? If so, should I go to advanced configuration options and select:
target options -->-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc) Target Optimizations
Or are these used by default anyway?
You can check with adding
V=s to your
jeff@deb-devel:~/devel/openwrt$ fgrep -r CFLAGS include
reveals at least (context not examined):
include/target.mk: CPU_CFLAGS = -Os -pipe
include/target.mk: CPU_CFLAGS += -mno-branch-likely
include/target.mk: CPU_CFLAGS_24kc = -mips32r2 -mtune=24kc
include/target.mk: DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE)))
include/target.mk: echo 'Target-Optimization: $(if $(CFLAGS),$(CFLAGS),$(DEFAULT_CFLAGS))'; \
-Os is set by default
The kernel is also optimized for performance by default (probably a bad idea to change this however), there are also a few kernel options you can disable if you want to keep the size down.