Re: [PATCH] objtool: remove generated files with make clean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 1, 2019 at 7:29 AM Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> On Thu, Feb 28, 2019 at 09:12:19PM +0100, Robin Meijboom wrote:
> > Hi Masahiro,
> >
> > On 28-02-19 14:36, Masahiro Yamada wrote:
> > > On Fri, Feb 15, 2019 at 11:15 AM Robin Meijboom <robin@xxxxxxxxxxxxx> wrote:
> > >>
> > >> Make clean currently does not remove the generated files for objtool:
> > >> tools/objtool/objtool, tools/objtool/fixdep, and
> > >> tools/objtool/arch/x86/lib/inat-tables.c.
> > >>
> > >> Clean these files up as part of make clean.
> > >>
> > >> Fixes: b9ab5ebb14ec ("objtool: Add CONFIG_STACK_VALIDATION option") and
> > >> bug report 199485 (https://bugzilla.kernel.org/show_bug.cgi?id=199485).
> > >>
> > >> Signed-off-by: Robin Meijboom <robin@xxxxxxxxxxxxx>
> > >> ---
> > >> In the discussions I didn't find a reason for keeping the files, so I
> > >> assume it is an oversight. Otherwise I would have expected them to be
> > >> removed at least by make distconfig (which they are not).
> > >>
> > >> Tested by compiling, cleaning, compiling again, and booting on x86_64.
> > >>
> > >> diff --git a/Makefile b/Makefile
> > >> index 141653226f3c..81a8149a805f 100644
> > >> --- a/Makefile
> > >> +++ b/Makefile
> > >> @@ -1328,6 +1328,8 @@ endif # CONFIG_MODULES
> > >>
> > >>   # Directories & files removed with 'make clean'
> > >>   CLEAN_DIRS  += $(MODVERDIR) include/ksym
> > >> +CLEAN_FILES += tools/objtool/objtool tools/objtool/fixdep \
> > >> +           tools/objtool/arch/$(ARCH)/lib/inat-tables.c
> > >>
> > >>   # Directories & files removed with 'make mrproper'
> > >>   MRPROPER_DIRS  += include/config usr/include include/generated          \
> > >>
> > >
> > >
> > >
> > > I see the same artifacts are cleaned up by tools/objtool/Makefile:
> > >
> > > https://github.com/torvalds/linux/blob/v5.0-rc7/tools/objtool/Makefile#L59
> > >
> > >
> > > So, this patch proves the 'clean' target
> > > in tools/objtool/Makefile is useless.
> > >
> >
> > True. I believe this is because kbuild does not descend into that directory
> > as it does with the other directories. It works if you issue 'make clean'
> > from tools or tools/objtool.
>
> Right.  Objtool is intended to be a standalone tool, though it's
> currently a bit kernel-specific.  So a clean target within tools/objtool
> makes sense I think.


Yeah, I remember you mentioned this before.
https://patchwork.kernel.org/patch/9983535/#20996149

Do you mean objtool will be split out from the kernel tree
in the future?

If objtool is useful for other projects in general
(like Sparse), it would be good,
and the top-level Makefile of kernel will add

export OBJTOOL  = /usr/bin/objtool

in case the user may want to install objtool
in a different path.





-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux