[U-Boot] [PATCH v3 1/4] kbuild, blackfin: Add CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED
Simon Glass
sjg at chromium.org
Fri Mar 7 23:13:20 CET 2014
Hi Masahiro,
On 5 March 2014 00:59, Masahiro Yamada <yamada.m at jp.panasonic.com> wrote:
> Many (but not all) of Blackfin boards give -O2 option
> to compile under lib/ directory.
> That means lib/ should be speed-optimized,
> whereas other parts should be size-optimized.
>
> We want to keep the same behavior,
> but do not want to parse board/*/config.mk again and again.
> We've got no choice but to invent a new method.
>
> CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED, if it is enabled,
> gives -O2 flag only for building under lib/ directory.
>
> Dirty codes which I had marked as "FIX ME"
> in board/${BOARD}/config.mk have been deleted.
> Instead, CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED has been
> defined in include/configs/${BOARD}.h.
>
> Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
> Cc: Sonic Zhang <sonic.zhang at analog.com>
Acked-by: Simon Glass <sjg at chromium.org>
> diff --git a/lib/Makefile b/lib/Makefile
> index dedb97b..8814ff9 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -65,3 +65,5 @@ obj-y += vsprintf.o
> obj-$(CONFIG_RANDOM_MACADDR) += rand.o
> obj-$(CONFIG_BOOTP_RANDOM_DELAY) += rand.o
> obj-$(CONFIG_CMD_LINK_LOCAL) += rand.o
> +
> +subdir-ccflags-$(CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED) += -O2
I guess this gets added after the -Os so supersedes it. I wonder what
happens if debugging is enabled? Still this is the same as before I
think.
Regards,
Simon
More information about the U-Boot
mailing list