[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAS8xkZCK5keS9SEdNTUsVRb+_hac4yvBG=1HebrkheAqw@mail.gmail.com>
Date: Wed, 16 Jan 2019 00:01:08 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Alexey Kardashevskiy <aik@...abs.ru>
Cc: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Samuel Holland <samuel@...lland.org>,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
Michael Ellerman <mpe@...erman.id.au>,
"linux-stable # v4 . 20" <stable@...r.kernel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kbuild: mark prepare0 as PHONY to fix external module build
On Tue, Jan 15, 2019 at 7:45 PM Alexey Kardashevskiy <aik@...abs.ru> wrote:
>
>
>
> On 15/01/2019 18:19, Masahiro Yamada wrote:
> > Commit c3ff2a5193fa ("powerpc/32: add stack protector support")
> > caused kernel panic on PowerPC if an external module is used with
> > CONFIG_STACKPROTECTOR because the 'prepare' target was not executed
> > for the external module build.
> >
> > Commit e07db28eea38 ("kbuild: fix single target build for external
> > module") turned it into a build error because the 'prepare' target is
> > now executed but the 'prepare0' target is missing for the external
> > module build.
> >
> > External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is
> > also broken in the same way.
> >
> > Move 'PHONY += prepare0' to the common place. Make is fine with missing
> > rule for phony targets.
> >
> > I minimize the change so it can be easily backported to 4.20.x
> >
> > To fix v4.20 for external modules of PowerPC, please backport
> > e07db28eea38 ("kbuild: fix single target build for external module"),
> > and then this commit.
> >
> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891
> > Fixes: e07db28eea38 ("kbuild: fix single target build for external module")
> > Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support")
> > Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries")
> > Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries")
> > Cc: linux-stable <stable@...r.kernel.org> # v4.20
> > Reported-by: Samuel Holland <samuel@...lland.org>
> > Reported-by: Alexey Kardashevskiy <aik@...abs.ru>
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
>
>
> Tested-by: Alexey Kardashevskiy <aik@...abs.ru>
>
> Thanks for fixing this! Out of curiosity - how does this work?
> arch/powerpc/Makefile's stack_protector_prepare still depends on
> prepare0 which is still defined only if KBUILD_EXTMOD=="" but somehow it
> does not bother ./Makefile? Thanks,
Missing phony targets are ignored.
I do not know if it is officially documented,
but GNU Make works like that.
Is the following test code helpful?
[Test Makefile]
prepare: prepare0
@echo hello world
.PHONY: prepare prepare0
[Result]
$ make
hello world
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists