[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNARvZZa-RgLCs9hwwgwrH-frxL6H1a3=BQzHmVqX6sPhTw@mail.gmail.com>
Date: Tue, 20 Nov 2018 10:13:53 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Nicolas Pitre <nicolas.pitre@...aro.org>
Cc: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Sam Ravnborg <sam@...nborg.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
linux-arch <linux-arch@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
Michael Ellerman <mpe@...erman.id.au>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Will Deacon <will.deacon@....com>,
Ingo Molnar <mingo@...nel.org>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>
Subject: Re: [PATCH 4/8] kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS
Hi Nicolas,
On Sat, Nov 17, 2018 at 2:50 AM Nicolas Pitre <nicolas.pitre@...aro.org> wrote:
> > > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> > > > index 7f3ca6e..e5ba9b1 100644
> > > > --- a/scripts/Makefile.build
> > > > +++ b/scripts/Makefile.build
> > > > @@ -254,9 +254,18 @@ objtool_dep = $(objtool_obj) \
> > > > $(wildcard include/config/orc/unwinder.h \
> > > > include/config/stack/validation.h)
> > > >
> > > > +ifdef CONFIG_TRIM_UNUSED_KSYMS
> > > > +cmd_gen_ksymdeps = \
> > > > + $(CONFIG_SHELL) $(srctree)/scripts/gen_ksymdeps.sh $@ > $(dot-target).tmp; \
> > > > + cat $(dot-target).tmp >> $(dot-target).cmd; \
> > > > + rm -f $(dot-target).tmp;
> > >
> > > Why don't you append to $(dot-target).cmd directly?
> >
> >
> > If scripts/gen_ksymdeps.sh fails for some reasons,
> > it will error out immediately thanks to 'set -e' flag.
> >
> > Appending incomplete portion might end up with a corrupted .*.cmd file.
> >
> > Probably, that would not happen, but I just wanted to ensure it.
>
> Well, strictly speaking, if scripts/gen_ksymdeps.sh fails and its output
> isn't appended at all to the .*.cmd file, then that .*.cmd file is
> already corrupted as it is missing necessary dependencies. Would be
> better to delete the .*.cmd file entirely in that case.
More strictly speaking, missing necessary dependencies is not a big deal.
Now, scripts/Kbuild.include specifies .DELETE_ON_ERROR
Any error in fixdep, gen_ksymdeps.sh, or whatever
will delete *.o file anyway.
So, I change the course
so that fixdep and gen_ksymdeps.sh directly write to .*.cmd files.
I wrote detailed explanation here:
https://patchwork.kernel.org/patch/10689697/
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists