[RFC PATCH] allow choosing -Os/-O2 separately for SPL and TPL

Simon Glass sjg at chromium.org
Wed Jun 17 01:37:10 CEST 2020


On Fri, 5 Jun 2020 at 02:37, Rasmus Villemoes
<rasmus.villemoes at prevas.dk> wrote:
>
> It can be useful to build U-Boot proper with -O2, but still optimize
> the SPL for size. So add separate config options for SPL and TPL.
>
> I had to move the Makefile logic to config.mk, since otherwise
> SPL_TPL_ didn't seem to be known. Unfortunately, the SPL translation
> units end up getting both -O2 and -Os passed (assuming
> CC_OPTIMIZE_FOR_SIZE=n, SPL_CC_OPTIMIZE_FOR_SIZE=y) - it ends up with
> the intended effect, but it is still not very pretty.
>
> My Kbuild fu is pretty weak; I wonder how the two uses of $(SPL_) in
> the main Makefile works when apparently $(SPL_TPL_) didn't.

They are defined in Makefile.spl and Kbuild/include.

But SPL_TPL_ is never defined unless CONFIG_SPL_BUILD is defined, i.e.
only in Makefile.spl I think.

+Masahiro Yamada who may know

>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
> ---
>  Kconfig   | 20 ++++++++++++++++++++
>  Makefile  |  6 ------
>  config.mk |  6 ++++++
>  3 files changed, 26 insertions(+), 6 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list