[PATCH v2 3/3] kbuild: SPL/TPL: generate separate asm-offsets.h for SPL and TPL

Bin Meng bmeng.cn at gmail.com
Sat Apr 18 14:37:09 CEST 2020


On Fri, Apr 17, 2020 at 3:22 PM Masahiro Yamada <masahiroy at kernel.org> wrote:
>
> Currently generic-asm-offsets.h and asm-offsets.h are generated based
> on U-Boot proper config options. The same asm-offsets headers are used
> for building U-Boot SPL/TPL, which causes potential offset mismatch if
> U-Boot proper has different config options from U-Boot SPL/TPL.
>
> This commit adds:
>   spl/include/generated/(generic-)asm-offsets.h
>   tpl/include/generated/(generic-)asm-offsets.h
>
> spl/include/generated/(generic-)asm-offsets.h is generated if
> CONFIG_SPL=y, and included when building SPL.
>
> tpl/include/generated/(generic-)asm-offsets.h is generated if
> CONFIG_TPL=y, and included when building TPL.
>
> They are created before Kbuild descends into SPL/TPL object directories
> and builds $(obj)/dts/dt-platdata.o because $(obj)/dts/dt-platdata.c
> includes a bunch of headers.
>
> Prepend -I$(obj)/include to $(UBOOTINCLUDE) so (generic-)asm-offsets.h
> is searched in {spl,tpl}/include/generated/.
>
> Requested-by: Bin Meng <bmeng.cn at gmail.com>
> Signed-off-by: Masahiro Yamada <masahiroy at kernel.org>
> ---
>
> Changes in v2: None
>
>  Kbuild               |  4 ++--
>  scripts/Makefile.spl | 10 ++++++++--
>  2 files changed, 10 insertions(+), 4 deletions(-)
>

It works like a charm. Thanks!

Tested-by: Bin Meng <bmeng.cn at gmail.com>


More information about the U-Boot mailing list