Re: [PATCH] powerpc: get rid of #include <generated/compile.h>
From: Scott Wood
Date: Sat Jun 04 2022 - 22:27:04 EST
On Sat, 2022-06-04 at 17:50 +0900, Masahiro Yamada wrote:
> You cannot include <generated/compile.h> here because it is generated
> in init/Makefile but there is no guarantee that it happens before
> arch/powerpc/mm/nohash/kaslr_booke.c is compiled for parallel builds.
>
> The places where you can reliably include <generated/compile.h> are:
>
> - init/ (because init/Makefile can specify the dependency)
> - arch/*/boot/ (because it is compiled after vmlinux)
>
> Commit f231e4333312 ("hexagon: get rid of #include <generated/compile.h>")
> fixed the last breakage at that time, but powerpc re-added this.
>
> <genearated/compile.h> was unneeded because 'build_str' is almost the
> same as 'linux_banner' defined in init/version.c
>
> Let's copy the solution from MIPS.
> (get_random_boot() in arch/mips/kernel/relocate.c)
>
> Fixes: 6a38ea1d7b94 ("powerpc/fsl_booke/32: randomize the kernel image
> offset")
> Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
> ---
>
> If this gets into the mainline before -rc2 or -rc3,
> I will base my kbuild work on top of this.
>
>
> arch/powerpc/mm/nohash/kaslr_booke.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
Acked-by: Scott Wood <oss@xxxxxxxxxxxx>
-Scott