
Hello Tom,
Kbuild brought about many advantages for us but a significant performance regression was reported by Simon Glass.
After some discussions and analysis, it turned out its main cause is in $(call cc-option,...).
Historically, U-Boot parses all config.mk (arch/*/config.mk and board/*/config.mk) every time descending into subdirectories. That means cc-options are evaluated over and over again.
$(call cc-option,...) is useful but costly. So we want to evaluate them only in ./Makefile and spl/Makefile and export compiler flags.
This commit changes the build system as follows:
Please hold applying this patch. I have found a bug in this patch.
microblaze-generic board will be broken with this patch. ( microblaze-linux-gcc fails in building this board, so I missed this bug when I tested this series.)
I will post version 3 tomorrow.
Best Regards Masahiro Yamada