PD#150373: gcc: add options to limit large object and stack usage
We should restrict limit large size of global object allocated in
driver code to reduce size of .data/.bss/.rodata sections. Also,
large array/many variables declared in a function is not allowed,
this behavior may cause kernel stack overflow especially in IRQ
context or recursion calls.
Right now we just set a very high limit in order to pass comiple.
Final target is to limit:
1. large global object size should not over 4096 bytes, a page size;
2. stack usage of each function should not over 256 bytes.
If your global object is larger than a page size, we advise allocate
it as a static pointer, and allocate it's memory during probe stage.
Change-Id: Ic14995f642bc1e0b47d3a07143468e6e1dac7bfc
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
## Do not change.
##########################################
+KBUILD_CFLAGS += -Wlarger-than=28792
+KBUILD_CFLAGS += -Wstack-usage=1856
+
+# These 2 marked sentence is just for generate warning messages
+#KBUILD_CFLAGS += -Wno-error=larger-than=28792
+#KBUILD_CFLAGS += -Wno-error=stack-usage=1856
+
obj-$(CONFIG_CPU_FREQ) += cpufreq/
obj-$(CONFIG_AMLOGIC_UART) += uart/
dtknq1_data_t dtknqr1;
uint32_t in_tkn_epnums[4];
uint8_t seqnum[MAX_EPS_CHANNELS];
- uint8_t intkn_seq[TOKEN_Q_DEPTH];
+ uint8_t intkn_seq[32];
grstctl_t resetctl = {.d32 = 0 };
uint8_t temp;
int ndx = 0;
+KBUILD_CFLAGS += -Wlarger-than=28792
+KBUILD_CFLAGS += -Wstack-usage=1856
+
obj-$(CONFIG_AMLOGIC_SND_SOC) += meson/
obj-$(CONFIG_AMLOGIC_SND_SOC) += auge/
+KBUILD_CFLAGS += -Wlarger-than=28792
+KBUILD_CFLAGS += -Wstack-usage=1856
+
#Amlogic
snd-soc-dummy_codec-objs := dummy_codec.o
snd-soc-pdm-dummy-objs := pdm_dummy.o